Exemplo n.º 1
0
 public void TestIsEncodable()
 {
     Assert.IsTrue(AudioUtility.IsEncodable(AudioMixdown.Mono));
     Assert.IsTrue(AudioUtility.IsEncodable(AudioMixdown.Stereo));
     Assert.IsTrue(AudioUtility.IsEncodable(AudioMixdown.Surround5dot1));
     Assert.IsFalse(AudioUtility.IsEncodable(AudioMixdown.Surround7dot1));
 }
Exemplo n.º 2
0
        public ConfigViewModel(IConfigManager <TricycleConfig> tricycleConfigManager,
                               IConfigManager <FFmpegConfig> ffmpegConfigManager,
                               IConfigManager <Dictionary <string, JobTemplate> > templateManager,
                               IAppManager appManager,
                               IFolderBrowser folderBrowser,
                               IDevice device,
                               string defaultDestinationDirectory)
        {
            _tricycleConfigManager = tricycleConfigManager;
            _ffmpegConfigManager   = ffmpegConfigManager;
            _templateManager       = templateManager;
            _appManager            = appManager;
            _folderBrowser         = folderBrowser;
            _device = device;
            _defaultDestinationDirectory     = defaultDestinationDirectory;
            _destinationDirectoryModeOptions = Enum.GetValues(typeof(AutomationMode))
                                               .Cast <AutomationMode>()
                                               .Select(o => new ListItem(o))
                                               .ToList();
            _deinterlaceSwitchOptions = Enum.GetValues(typeof(SmartSwitchOption))
                                        .Cast <SmartSwitchOption>()
                                        .Select(o => new ListItem(o))
                                        .ToList();
            _x264PresetOptions = new List <ListItem>()
            {
                new ListItem("ultrafast"),
                new ListItem("superfast"),
                new ListItem("veryfast"),
                new ListItem("faster"),
                new ListItem("fast"),
                new ListItem("medium"),
                new ListItem("slow"),
                new ListItem("slower"),
                new ListItem("veryslow"),
                new ListItem("placebo"),
            };
            _x265PresetOptions  = _x264PresetOptions;
            _audioFormatOptions = new List <ListItem>()
            {
                EMPTY_ITEM,
                GetAudioFormatOption(AudioFormat.Aac),
                GetAudioFormatOption(AudioFormat.Ac3)
            };
            _audioMixdownOptions = Enum.GetValues(typeof(AudioMixdown))
                                   .Cast <AudioMixdown>()
                                   .Where(m => AudioUtility.IsEncodable(m))
                                   .Select(m => GetAudioMixdownOption(m))
                                   .ToList();

            _audioMixdownOptions.Insert(0, EMPTY_ITEM);

            _appManager.Quitting += OnAppQuitting;

            BackCommand = new Command(() => _appManager.RaiseModalClosed());
            DestinationBrowseCommand =
                new Command(async() => await SelectDestinationDirectory(),
                            () => object.Equals(SelectedDestinationDirectoryMode?.Value, AutomationMode.Manual));
        }