/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. */ public class VideoSourceCollection : MediaSourceCollection { public enum State { UNKNOWN, ONLINE, OFFLINE, TRASH } public override TransactionController transaction_controller { get { if (_transaction_controller == null) _transaction_controller = new MediaSourceTransactionController(this); return _transaction_controller; } } private TransactionController _transaction_controller = null; private Gee.MultiMap filesize_to_video = new Gee.TreeMultiMap(uint64_compare); public VideoSourceCollection() { base("VideoSourceCollection", get_video_key); get_trashcan().contents_altered.connect(on_trashcan_contents_altered); get_offline_bin().contents_altered.connect(on_offline_contents_altered); } protected override MediaSourceHoldingTank create_trashcan() { return new MediaSourceHoldingTank(this, is_video_trashed, get_video_key); } protected override MediaSourceHoldingTank create_offline_bin() { return new MediaSourceHoldingTank(this, is_video_offline, get_video_key); } public override MediaMonitor create_media_monitor(Workers workers, Cancellable cancellable) { return new VideoMonitor(cancellable); } public override bool holds_type_of_source(DataSource source) { return source is Video; } public override string get_typename() { return Video.TYPENAME; } public override bool is_file_recognized(File file) { return VideoReader.is_supported_video_file(file); } private void on_trashcan_contents_altered(Gee.Collection? added, Gee.Collection? removed) { trashcan_contents_altered((Gee.Collection