Logo Search packages:      
Sourcecode: ultrastar-ng version File versions  Download package

CAudio::CAudio (  ) 

Constructor This constructor initialise the API audio drivers

Definition at line 9 of file audio.cpp.

              : m_type() {
      xine = xine_new();
      vo_port = xine_open_video_driver (xine, NULL, XINE_VISUAL_TYPE_NONE, NULL);    /*Create a fake vo_port*/ 
      ao_port = xine_open_audio_driver(xine , "auto", NULL);
      stream = xine_stream_new(xine, ao_port, vo_port);
      event_queue = xine_event_new_queue(stream);
      xine_playing = 0;
      /* init GStreamer */
      gst_init (NULL, NULL);
      /* set up */
      GstElement *sink=NULL;
      GstElement *fakesink=NULL;
      music = gst_element_factory_make ("playbin", "play");
      /*If you don't want play video with gstreamer*/
      fakesink = gst_element_factory_make ("fakesink", "fakesink");
      g_object_set (G_OBJECT (music), "video-sink", fakesink, NULL);
      /*Output sink*/
      sink = gst_element_factory_make ("gconfaudiosink", "audiosink");
      /* if we could create the gconf sink use that, otherwise let playbin decide */
      if (sink != NULL) {
            /* set the profile property on the gconfaudiosink to "music and movies" */
            if (g_object_class_find_property (G_OBJECT_GET_CLASS (sink), "profile"))
              g_object_set (G_OBJECT (sink), "profile", 1, NULL);
            g_object_set (G_OBJECT (music), "audio-sink", sink, NULL);
      length = 0;
      m_thread.reset(new boost::thread(boost::ref(*this)));

Generated by  Doxygen 1.6.0   Back to index