[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    extragear/multimedia/k3b/src
From:       Sebastian Trueg <sebastian () trueg ! de>
Date:       2006-08-05 14:27:19
Message-ID: 1154788039.019512.9122.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 570020 by trueg:

* Made Ogg-Vorbis the default audio ripping format.
* Use the long readable file pattern in the default file naming schemes.


 M  +6 -12     k3bemptydiscwaiter.cpp  
 M  +3 -0      k3bfileview.cpp  
 M  +34 -2     rip/k3baudioconvertingoptionwidget.cpp  
 M  +8 -8      rip/k3bcddbpatternwidget.cpp  
 M  +4 -7      rip/k3bpatternparser.cpp  


--- trunk/extragear/multimedia/k3b/src/k3bemptydiscwaiter.cpp #570019:570020
@@ -318,7 +318,7 @@
 	  connect( &job, SIGNAL(percent(int)), d->erasingInfoDialog, SLOT(setProgress(int)) \
);  connect( d->erasingInfoDialog, SIGNAL(cancelClicked()), &job, SLOT(cancel()) );
 	  job.start( medium.diskInfo() );
-	  d->erasingInfoDialog->exec(true);
+	  d->erasingInfoDialog->exec( true );
 	}
       }
       else {
@@ -494,7 +494,7 @@
 	connect( &job, SIGNAL(percent(int)), d->erasingInfoDialog, SLOT(setProgress(int)) \
);  connect( d->erasingInfoDialog, SIGNAL(cancelClicked()), &job, SLOT(cancel()) );
 	job.start( medium.diskInfo() );
-	d->erasingInfoDialog->exec(true);
+	d->erasingInfoDialog->exec( true );
       }
       else {
 	kdDebug() << "(K3bEmptyDiscWaiter) starting devicehandler: no DVD-RW formatting." \
<< endl; @@ -568,7 +568,7 @@
       connect( &job, SIGNAL(finished(bool)), this, SLOT(slotErasingFinished(bool)) \
                );
       connect( d->erasingInfoDialog, SIGNAL(cancelClicked()), &job, SLOT(cancel()) \
);  job.start();
-      d->erasingInfoDialog->exec(false);
+      d->erasingInfoDialog->exec( false );
     }
     else {
       kdDebug() << "(K3bEmptyDiscWaiter) starting devicehandler: no CD-RW \
overwrite." << endl; @@ -666,22 +666,16 @@
 	     SLOT(slotReloadingAfterErasingFinished(K3bDevice::DeviceHandler*)) );
   }
   else {
-    d->blockMediaChange = true;
     K3bDevice::eject( d->device );
-    d->erasingInfoDialog->hide();
-    KMessageBox::error( parentWidgetToUse(), i18n("Erasing failed.") );
-    d->blockMediaChange = false;
-
-    if( d->mediumChanged ) {
-      d->mediumChanged--;
-      slotMediumChanged( d->device );
-    }
+    KMessageBox::error( d->erasingInfoDialog, i18n("Erasing failed.") );
+    d->erasingInfoDialog->hide(); // close the dialog thus ending it's event loop -> \
back to slotMediumChanged  }
 }
 
 
 void K3bEmptyDiscWaiter::slotReloadingAfterErasingFinished( \
K3bDevice::DeviceHandler* )  {
+  // close the dialog thus ending it's event loop -> back to slotMediumChanged
   d->erasingInfoDialog->hide();
 }
 
--- trunk/extragear/multimedia/k3b/src/k3bfileview.cpp #570019:570020
@@ -84,6 +84,9 @@
   m_toolBox->addButton( actionHome );
   m_toolBox->addButton( actionReload );
   m_toolBox->addSpacing();
+  m_toolBox->addButton( m_dirOp->actionCollection()->action("short view") );
+  m_toolBox->addButton( m_dirOp->actionCollection()->action("detailed view") );
+  m_toolBox->addSpacing();
   m_toolBox->addButton( m_dirOp->bookmarkMenu() );
   m_toolBox->addSpacing();
 
--- trunk/extragear/multimedia/k3b/src/rip/k3baudioconvertingoptionwidget.cpp \
#570019:570020 @@ -45,6 +45,35 @@
   QTimer freeSpaceUpdateTimer;
 
   KIO::filesize_t neededSize;
+
+  int getDefaultFormat() {
+    // we prefere formats in this order:
+    // 1. ogg
+    // 2. mp3
+    // 3. flac
+    // 4. wave
+    int ogg = -1;
+    int mp3 = -1;
+    int flac = -1;
+    for( QMap<int, QString>::const_iterator it = extensionMap.constBegin();
+	 it != extensionMap.constEnd(); ++it ) {
+      if( it.data() == "ogg" )
+	ogg = it.key();
+      else if( it.data() == "mp3" )
+	mp3 = it.key();
+      else if( it.data() == "flac" )
+	flac = it.key();
+    }
+
+    if( ogg > -1 )
+      return ogg;
+    else if( mp3 > -1 )
+      return mp3;
+    else if( flac > -1 )
+      return flac;
+    else
+	return 0;
+  }
 };
 
 
@@ -69,6 +98,9 @@
   m_editBaseDir->setMode( KFile::Directory | KFile::ExistingOnly | KFile::LocalOnly \
);  m_buttonConfigurePlugin->setIconSet( SmallIconSet( "gear" ) );
 
+  // FIXME: see if sox and the sox encoder are installed and if so do not put the \
internal wave +  //        writer in the list of encoders.
+
   d->encoderMap.clear();
   d->extensionMap.clear();
   m_comboFileType->clear();
@@ -180,7 +212,7 @@
   m_editBaseDir->setURL( QDir::homeDirPath() );
   m_checkSingleFile->setChecked( false );
   m_checkWriteCueFile->setChecked( false );
-  m_comboFileType->setCurrentItem(0); // Wave
+  m_comboFileType->setCurrentItem( d->getDefaultFormat() );
   m_checkCreatePlaylist->setChecked(false);
   m_checkPlaylistRelative->setChecked(false);
 
@@ -198,7 +230,7 @@
   m_checkCreatePlaylist->setChecked( c->readBoolEntry( "create_playlist", false ) );
   m_checkPlaylistRelative->setChecked( c->readBoolEntry( \
"relative_path_in_playlist", false ) );  
-  QString filetype = c->readEntry( "filetype", "wav" );
+  QString filetype = c->readEntry( "filetype", \
d->extensionMap[d->getDefaultFormat()] );  if( filetype == "wav" )
     m_comboFileType->setCurrentItem(0);
   else {
--- trunk/extragear/multimedia/k3b/src/rip/k3bcddbpatternwidget.cpp #570019:570020
@@ -47,14 +47,14 @@
   m_editBlankReplace->setValidator( dirValidator );
 
   // default pattern
-  m_comboFilenamePattern->insertItem( i18n( "%A/%T/%a - %t" ) );
-  m_comboFilenamePattern->insertItem( i18n( "%g/%A - %T/Track%n" ) );
+  m_comboFilenamePattern->insertItem( i18n( "%{albumartist} - \
%{albumtitle}/%{artist} - %{title}" ) ); +  m_comboFilenamePattern->insertItem( i18n( \
"%{genre}/%{albumartist} - %{albumtitle}/Track%{number}" ) );  \
m_comboFilenamePattern->insertItem( i18n( "music/ripped-tracks/%a - %t" ) );  \
m_comboFilenamePattern->insertItem( i18n("%A - %T/!a='%A'{%a - }%t") );  
-  m_comboPlaylistPattern->insertItem( i18n( "%A - %T" ) );
+  m_comboPlaylistPattern->insertItem( i18n( "%{albumartist} - %{albumtitle}" ) );
   m_comboPlaylistPattern->insertItem( i18n( "Playlist" ) );
-  m_comboPlaylistPattern->insertItem( i18n( "playlists/%A/%T" ) );
+  m_comboPlaylistPattern->insertItem( i18n( "playlists/%{albumartist}/%{albumtitle   \
}" ) );  
   connect( m_comboFilenamePattern, SIGNAL(textChanged(const QString&)),
 	   this, SIGNAL(changed()) );
@@ -102,8 +102,8 @@
 
 void K3bCddbPatternWidget::loadConfig( KConfigBase* c )
 {
-  m_comboPlaylistPattern->setEditText( c->readEntry( "playlist pattern", "%A - %T" ) \
                );
-  m_comboFilenamePattern->setEditText( c->readEntry( "filename pattern", "%A - %T/%a \
- %t" ) ); +  m_comboPlaylistPattern->setEditText( c->readEntry( "playlist pattern", \
"%{albumartist} - %{albumtitle}" ) ); +  m_comboFilenamePattern->setEditText( \
c->readEntry( "filename pattern", "%{albumartist} - %{albumtitle}/%{artist} - \
%{title}" ) );  m_checkBlankReplace->setChecked( c->readBoolEntry( "replace blanks", \
false ) );  m_editBlankReplace->setText( c->readEntry( "blank replace string", "_" ) \
);  }
@@ -120,8 +120,8 @@
 
 void K3bCddbPatternWidget::loadDefaults()
 {
-  m_comboPlaylistPattern->setEditText( "%A - %T.m3u" );
-  m_comboFilenamePattern->setEditText( "%A - %T/%a - %t" );
+  m_comboPlaylistPattern->setEditText( "%%{albumartist} - %{albumtitle}" );
+  m_comboFilenamePattern->setEditText( "%{albumartist} - %{albumtitle}/%{artist} - \
%{title}" );  m_checkBlankReplace->setChecked( false );
   m_editBlankReplace->setText( "_" );
 }
--- trunk/extragear/multimedia/k3b/src/rip/k3bpatternparser.cpp #570019:570020
@@ -197,20 +197,19 @@
   QString inclusion;
   bool isIncluded;
 
-  QRegExp* conditionrx =
-    new QRegExp( "^[@|!][atyegrmx](?:='.*')?\\{" );
-  conditionrx->setMinimal( TRUE );
+  static QRegExp conditionrx( "^[@|!][atyegrmx](?:='.*')?\\{" );
+  conditionrx.setMinimal( TRUE );
 
   for( unsigned int i = 0; i < dir.length(); ++i ) {
 
     offsetStack.push(
-      conditionrx->search(dir, i, QRegExp::CaretAtOffset) );
+      conditionrx.search(dir, i, QRegExp::CaretAtOffset) );
 
     if( offsetStack.top() == -1 ) {
       offsetStack.pop();
     }
     else {
-      i += conditionrx->matchedLength() - 1;
+      i += conditionrx.matchedLength() - 1;
       continue;
     }
 
@@ -294,8 +293,6 @@
 
   } // end of conditional inclusion for(...)
 
-  delete conditionrx;
-
   // end of Conditional Inclusion */
 
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic