diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-01-17 01:06:18 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-01-22 14:34:25 +0100 |
| commit | 8b3561f2acc149e0654b47558569e06a10e068c3 (patch) | |
| tree | cc41210ad80bffa1604cc75a9a68f2f38e3467bb /src/lib/cinema_list.cc | |
| parent | 02cac1475862cf4d35ec79f54e1b969fb2c538ea (diff) | |
Add screens() to get all screens.
Diffstat (limited to 'src/lib/cinema_list.cc')
| -rw-r--r-- | src/lib/cinema_list.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lib/cinema_list.cc b/src/lib/cinema_list.cc index 6805a42cd..f59a8f4f8 100644 --- a/src/lib/cinema_list.cc +++ b/src/lib/cinema_list.cc @@ -35,6 +35,7 @@ #include <numeric> +using std::function; using std::pair; using std::make_pair; using std::string; @@ -465,3 +466,15 @@ CinemaList::unique_utc_offset(std::set<CinemaID> const& cinemas_to_check) return offset; } + +void +CinemaList::screens(function<void (CinemaID, ScreenID, dcpomatic::Screen const& screen)> callback) const +{ + SQLiteStatement statement(_db, _screens.select("")); + statement.execute([this, &callback](SQLiteStatement& statement) { + auto const screen_id = statement.column_int64(0); + callback(statement.column_int64(1), screen_id, screen_from_result(statement, screen_id)); + }); + +} + |
