[mythtv] [mythtv-commits] mythtv commit: r13336 by nigel

Nigel Pearson nigel at ind.tansu.com.au
Tue May 1 19:11:56 UTC 2007


> Looks like this breaks a number of things in MythMusic regarding  
> playing CD's

Sorry about that.

> because it requires the cd device to be set every time a CdDecoder
> is created whereas before the device was set in the constructor. At  
> the
> moment playing and detecting the presence of a CD is well  broken :-(
>
> Setting the device in the constructor seems the right thing to do

Yes. In hindsight it would be better to do it that way.
I did it separately because I didn't want to break the
DecoderFactory* create() syntax, and was toying with the
idea of resetting the device for new MythMedia events.

I shouldn't commit now (too little sleep, untested),
but something like this should fix playback?

% svn diff
Index: databasebox.h
===================================================================
--- databasebox.h       (revision 13361)
+++ databasebox.h       (working copy)
@@ -27,6 +27,7 @@
    private:
+    QString             m_CDdevice;
      AllMusic*           all_music;
      PlaylistsContainer* the_playlists;
      bool                cd_status_changed;
@@ -38,7 +39,7 @@
      Q_OBJECT
    public:
      DatabaseBox(PlaylistsContainer *all_playlists,
-                AllMusic *music_ptr, MythMainWindow *parent,
+                AllMusic *music_ptr, MythMainWindow *parent, QString  
dev,
                  const QString &window_name, const QString  
&theme_filename,
                  const char *name = 0);
     ~DatabaseBox();
Index: databasebox.cpp
===================================================================
--- databasebox.cpp     (revision 13361)
+++ databasebox.cpp     (working copy)
@@ -24,7 +24,7 @@
DatabaseBox::DatabaseBox(PlaylistsContainer *all_playlists,
                           AllMusic *music_ptr, MythMainWindow *parent,
-                         const QString &window_name,
+                         QString device, const QString &window_name,
                           const QString &theme_filename, const char  
*name)
             : MythThemedDialog(parent, window_name, theme_filename,  
name)
{
@@ -111,7 +111,7 @@
          // Start the CD checking thread, and set up a timer to make  
it check
          // occasionally
-        cd_reader_thread = new ReadCDThread(the_playlists, all_music);
+        cd_reader_thread = new ReadCDThread(device, the_playlists,  
all_music);
          // filling initialy before thread running
          fillCD();
@@ -1229,9 +1229,10 @@
          cditem->setText(title);
}
-ReadCDThread::ReadCDThread(PlaylistsContainer *all_the_playlists,
+ReadCDThread::ReadCDThread(QString dev, PlaylistsContainer  
*all_the_playlists,
                             AllMusic *all_the_music)
{
+    m_CDdevice = dev;
      the_playlists = all_the_playlists;
      all_music = all_the_music;
      cd_status_changed = false;
@@ -1243,6 +1244,7 @@
      QMutexLocker locker(getLock());
      CdDecoder *decoder = new CdDecoder("cda", NULL, NULL, NULL);
+    decoder->setDevice(m_CDdevice);
      int tracknum = decoder->getNumCDAudioTracks();
      bool redo = false;
Index: main.cpp
===================================================================
--- main.cpp    (revision 13363)
+++ main.cpp    (working copy)
@@ -142,8 +142,15 @@
void startDatabaseTree(PlaylistsContainer *all_playlists, AllMusic  
*all_music)
{
+    QString dev;
+
+    if (gCDdevice.length())
+        dev = gCDdevice;
+    else
+        dev = MediaMonitor::defaultCDdevice();
+
      DatabaseBox dbbox(all_playlists, all_music, gContext- 
 >GetMainWindow(),
-                      "music_select", "music-", "music database");
+                      dev, "music_select", "music-", "music database");
      qApp->unlock();
      dbbox.exec();
      qApp->lock();

--
Nigel Pearson, nigel at ind.tansu.com.au|"Now the world has gone to bed,
Telstra Net. Eng., Sydney, Australia | Darkness won't engulf my head,
Office: 9202 3900    Fax:  9261 3912 | I can see by infrared,
Mobile: 0408 664435  Home: 9792 6998 | How I hate the night." -Marvin



More information about the mythtv-dev mailing list