コード例 #1
0
ファイル: PlayerEngine.cs プロジェクト: shaw1337/banshee
        public PlayerEngine()
        {
            Log.InformationFormat("GStreamer# {0} Initializing; {1}.{2}",
                                  typeof(Gst.Version).Assembly.GetName().Version, Gst.Version.Description, Gst.Version.Nano);

            // Setup the gst plugins/registry paths if running Windows
            if (PlatformDetection.IsWindows)
            {
                var gst_paths = new string [] { Hyena.Paths.Combine(Hyena.Paths.InstalledApplicationPrefix, "gst-plugins") };
                Environment.SetEnvironmentVariable("GST_PLUGIN_PATH", String.Join(";", gst_paths));
                Environment.SetEnvironmentVariable("GST_PLUGIN_SYSTEM_PATH", "");
                Environment.SetEnvironmentVariable("GST_DEBUG", "1");

                string registry = Hyena.Paths.Combine(Hyena.Paths.ApplicationData, "registry.bin");
                if (!System.IO.File.Exists(registry))
                {
                    System.IO.File.Create(registry).Close();
                }

                Environment.SetEnvironmentVariable("GST_REGISTRY", registry);

                //System.Environment.SetEnvironmentVariable ("GST_REGISTRY_FORK", "no");
                Log.DebugFormat("GST_PLUGIN_PATH = {0}", Environment.GetEnvironmentVariable("GST_PLUGIN_PATH"));
            }

            Gst.Application.Init();
            playbin = new PlayBin2();

            next_track_set = new ManualResetEvent(false);

            audio_sink = new AudioSinkBin("audiobin");

            playbin["audio-sink"] = audio_sink;

            if (audio_sink.VolumeNeedsSaving)
            {
                // Remember the volume from last time
                Volume = (ushort)PlayerEngineService.VolumeSchema.Get();
            }

            Pad teepad = audio_sink.RequestTeePad();

            visualization = new Visualization(audio_sink, teepad);

            playbin.AddNotification("volume", OnVolumeChanged);
            playbin.Bus.AddWatch(OnBusMessage);
            playbin.AboutToFinish += OnAboutToFinish;

            cdda_manager = new CddaManager(playbin);
            dvd_manager  = new DvdManager(playbin);
            // FIXME: Disable video stuff until GLib# 3 is used instead of the sopy bundled in GStreamerSharp
            //video_manager = new VideoManager (playbin);
            //video_manager.PrepareWindow += OnVideoPrepareWindow;
            //video_manager.Initialize ();

            dvd_manager.FindNavigation(playbin);
            OnStateChanged(PlayerState.Ready);
        }
コード例 #2
0
        protected override void Initialize()
        {
            playbin = ElementFactory.Make("playbin", "the playbin");

            next_track_set = new ManualResetEvent(false);

            audio_sink = new AudioSinkBin("audiobin");

            playbin["audio-sink"] = audio_sink;

            if (audio_sink.VolumeNeedsSaving)
            {
                // Remember the volume from last time
                Volume = (ushort)PlayerEngineService.VolumeSchema.Get();
            }

            visualization = new Visualization(audio_sink);

            playbin.AddNotification("volume", OnVolumeChanged);
            playbin.Bus.AddWatch(OnBusMessage);

            cdda_manager = new CddaManager(playbin);
            dvd_manager  = new DvdManager(playbin);

            video_manager = new VideoManager(playbin);
            video_manager.PrepareWindow += OnVideoPrepareWindow;
            video_manager.Initialize();

            dvd_manager.FindNavigation(playbin);

            OnStateChanged(PlayerState.Ready);

            InstallPreferences();
            audio_sink.ReplayGainEnabled = ReplayGainEnabledSchema.Get();
            GaplessEnabled = GaplessEnabledSchema.Get();
        }
コード例 #3
0
ファイル: PlayerEngine.cs プロジェクト: fatman2021/gnome-apps
        public PlayerEngine ()
        {
            Log.InformationFormat ("GStreamer# {0} Initializing; {1}.{2}",
                typeof (Gst.Version).Assembly.GetName ().Version, Gst.Version.Description, Gst.Version.Nano);

            // Setup the gst plugins/registry paths if running Windows
            if (PlatformDetection.IsWindows) {
                var gst_paths = new string [] { Hyena.Paths.Combine (Hyena.Paths.InstalledApplicationPrefix, "gst-plugins") };
                Environment.SetEnvironmentVariable ("GST_PLUGIN_PATH", String.Join (";", gst_paths));
                Environment.SetEnvironmentVariable ("GST_PLUGIN_SYSTEM_PATH", "");
                Environment.SetEnvironmentVariable ("GST_DEBUG", "1");

                string registry = Hyena.Paths.Combine (Hyena.Paths.ApplicationData, "registry.bin");
                if (!System.IO.File.Exists (registry)) {
                    System.IO.File.Create (registry).Close ();
                }

                Environment.SetEnvironmentVariable ("GST_REGISTRY", registry);

                //System.Environment.SetEnvironmentVariable ("GST_REGISTRY_FORK", "no");
                Log.DebugFormat ("GST_PLUGIN_PATH = {0}", Environment.GetEnvironmentVariable ("GST_PLUGIN_PATH"));
            }

            Gst.Application.Init ();
            playbin = new PlayBin2 ();

            next_track_set = new ManualResetEvent (false);

            audio_sink = new AudioSinkBin ("audiobin");

            playbin["audio-sink"] = audio_sink;

            if (audio_sink.VolumeNeedsSaving) {
                // Remember the volume from last time
                Volume = (ushort)PlayerEngineService.VolumeSchema.Get ();
            }

            Pad teepad = audio_sink.RequestTeePad ();
            visualization = new Visualization (audio_sink, teepad);

            playbin.AddNotification ("volume", OnVolumeChanged);
            playbin.Bus.AddWatch (OnBusMessage);
            playbin.AboutToFinish += OnAboutToFinish;

            cdda_manager = new CddaManager (playbin);
            dvd_manager = new DvdManager (playbin);
            // FIXME: Disable video stuff until GLib# 3 is used instead of the sopy bundled in GStreamerSharp
            //video_manager = new VideoManager (playbin);
            //video_manager.PrepareWindow += OnVideoPrepareWindow;
            //video_manager.Initialize ();

            dvd_manager.FindNavigation (playbin);
            OnStateChanged (PlayerState.Ready);
        }
コード例 #4
0
ファイル: PlayerEngine.cs プロジェクト: knocte/banshee
        protected override void Initialize()
        {
            playbin = ElementFactory.Make ("playbin", "the playbin");

            next_track_set = new ManualResetEvent (false);

            audio_sink = new AudioSinkBin ("audiobin");

            playbin["audio-sink"] = audio_sink;

            if (audio_sink.VolumeNeedsSaving) {
                // Remember the volume from last time
                Volume = (ushort)PlayerEngineService.VolumeSchema.Get ();
            }

            visualization = new Visualization (audio_sink);

            playbin.AddNotification ("volume", OnVolumeChanged);
            playbin.Bus.AddWatch (OnBusMessage);

            cdda_manager = new CddaManager (playbin);
            dvd_manager = new DvdManager (playbin);

            video_manager = new VideoManager (playbin);
            video_manager.PrepareWindow += OnVideoPrepareWindow;
            video_manager.Initialize ();

            dvd_manager.FindNavigation (playbin);

            OnStateChanged (PlayerState.Ready);

            InstallPreferences ();
            audio_sink.ReplayGainEnabled = ReplayGainEnabledSchema.Get ();
            GaplessEnabled = GaplessEnabledSchema.Get ();
        }