Am Thu, 27 Aug 2009 15:50:40 -0500 (CDT)
schrieb "Gabriel M. Beddingfield" <gabr...@teuton.org>:

> 
> Hi Michael,
> 
> On Thu, 27 Aug 2009, m.wolkst...@gmx.de wrote:
> >>> I've seen that you're using std::string's in some places instead of
> >>> QString's. Maybe you could change that and merge it then?
> >>
> >> Please, no.  :-)  We're *almost* there.  Almost about to make a stable
> >> release.  :-)  No new features, please.
> > hiho,
> > the playlist is no new trunk feature. maybe here is a misunderstanding.
> > it's sins 1 year in trunk.
> > i only have redesigned the confusion button arrangement around the playlist.
> > the player-control was already there. but with simple push buttons.
> > i only have tuned the buttons. as new feature i add the fwd + rwd buttons. 
> > but this
> > code is totally save. and the new "add current song to playlist" function 
> > based on
> > the tested "add song to playlist" function. also this is more or less a 
> > bugfix,
> > because, i have totally forgotten this feature if i have create the 
> > playlist last
> > year. greetings wolke
> 
> Well, I'm still suspicious.
> 
> Can you point me to which commits have the changes on your branch?  Or, 
> maybe make a patch and email it?
ok...ok, here is a patch against trunk rev. 1331

here i also have replace all left std::string to QString, as sebastian has 
suggested.
the diff contains also the playlist_background_Control.png.
greetings wolke.

 


> Thanks,
> Gabriel

> 
Index: gui/src/PlaylistEditor/PlaylistDialog.cpp
===================================================================
--- gui/src/PlaylistEditor/PlaylistDialog.cpp	(Revision 1331)
+++ gui/src/PlaylistEditor/PlaylistDialog.cpp	(Arbeitskopie)
@@ -25,6 +25,7 @@
 #include "../HydrogenApp.h"
 #include "../InstrumentRack.h"
 #include "SoundLibrary/SoundLibraryPanel.h"
+#include "widgets/PixmapWidget.h"
 
 #include <hydrogen/LocalFileMng.h>
 #include <hydrogen/h2_exception.h>
@@ -55,11 +56,107 @@
 
 	setupUi ( this );
 	INFOLOG ( "INIT" );
-	setWindowTitle ( trUtf8 ( "Play List Browser" ) );
+	setWindowTitle ( trUtf8 ( "Play List Browser" ) + QString(" ") + QString("- ") + QString( Playlist::get_instance()->__playlistName  ) );
 	setFixedSize ( width(), height() );
 	installEventFilter(this);
 
+
+	// menubar
+	QMenuBar *m_pMenubar = new QMenuBar( this );
+//	setMenuBar( m_pMenubar );
+
+	// Playlist menu
+	QMenu *m_pPlaylistMenu = m_pMenubar->addMenu( trUtf8( "&Playlist" ) );
+
+	m_pPlaylistMenu->addAction( trUtf8( "Add song to Play&list" ), this, SLOT( addSong() ), QKeySequence( "" ) );
+	m_pPlaylistMenu->addAction( trUtf8( "Add &current song to Playlist" ), this, SLOT( addCurrentSong() ), QKeySequence( "" ) );
+	m_pPlaylistMenu->addSeparator();				// -----
+	m_pPlaylistMenu->addAction( trUtf8( "&Remove selected song from Playlist" ), this, SLOT( removeFromList() ), QKeySequence( "" ) );
+	m_pPlaylistMenu->addAction( trUtf8( "Remove all songs from &Playlistist " ), this, SLOT( clearPlaylist() ), QKeySequence( "" ) );
+	m_pPlaylistMenu->addSeparator();
+	m_pPlaylistMenu->addAction( trUtf8( "&Open Playlist" ), this, SLOT( loadList() ), QKeySequence( "" ) );
+	m_pPlaylistMenu->addSeparator();
+	m_pPlaylistMenu->addAction( trUtf8( "&Save Playlist" ), this, SLOT( saveList() ), QKeySequence( "" ) );
+	m_pPlaylistMenu->addAction( trUtf8( "Save Playlist &as" ), this, SLOT( saveListAs() ), QKeySequence( "" ) );
+
+#ifdef WIN32
+	//no scripts under windows
+#else
+	// Script menu
+	QMenu *m_pScriptMenu = m_pMenubar->addMenu( trUtf8( "&Scripts" ) );
+
+	m_pScriptMenu->addAction( trUtf8( "&Add Script to selected song" ), this, SLOT( loadScript() ), QKeySequence( "" ) );
+	m_pScriptMenu->addAction( trUtf8( "&Edit selected Script" ), this, SLOT( editScript() ), QKeySequence( "" ) );
+	m_pScriptMenu->addSeparator();
+	m_pScriptMenu->addAction( trUtf8( "&Remove selected Script" ), this, SLOT( removeScript() ), QKeySequence( "" ) );
+	m_pScriptMenu->addSeparator();
+	m_pScriptMenu->addAction( trUtf8( "&Create a new Script" ), this, SLOT( newScript() ), QKeySequence( "" ) );
+#endif
+
+
+// CONTROLS
+	PixmapWidget *pControlsPanel = new PixmapWidget( NULL );
+	pControlsPanel->setFixedSize( 119, 32 );
+	pControlsPanel->setPixmap( "/playerControlPanel/playlist_background_Control.png" );
+	playerControl->addWidget( pControlsPanel );
 	
+
+
+	// Rewind button
+	m_pRwdBtn = new Button(
+			pControlsPanel,
+			"/playerControlPanel/btn_rwd_on.png",
+			"/playerControlPanel/btn_rwd_off.png",
+			"/playerControlPanel/btn_rwd_over.png",
+			QSize(21, 15)
+	);
+	m_pRwdBtn->move(6, 6);
+	m_pRwdBtn->setToolTip( trUtf8("Rewind") );
+	connect(m_pRwdBtn, SIGNAL(clicked(Button*)), this, SLOT(rewindBtnClicked(Button*)));
+
+
+	// Play button
+	m_pPlayBtn = new ToggleButton(
+			pControlsPanel,
+			"/playerControlPanel/btn_play_on.png",
+			"/playerControlPanel/btn_play_off.png",
+			"/playerControlPanel/btn_play_over.png",
+			QSize(33, 17)
+	);
+	m_pPlayBtn->move(33, 6);
+	m_pPlayBtn->setPressed(false);
+	m_pPlayBtn->setToolTip( trUtf8("Play/ Pause/ Load selected song") );
+	connect(m_pPlayBtn, SIGNAL(clicked(Button*)), this, SLOT(nodePlayBTN(Button*)));
+
+	// Stop button
+	m_pStopBtn = new Button(
+			pControlsPanel,
+			"/playerControlPanel/btn_stop_on.png",
+			"/playerControlPanel/btn_stop_off.png",
+			"/playerControlPanel/btn_stop_over.png",
+			QSize(21, 15)
+	);
+	m_pStopBtn->move(65, 6);
+	m_pStopBtn->setToolTip( trUtf8("Stop") );
+	connect(m_pStopBtn, SIGNAL(clicked(Button*)), this, SLOT(nodeStopBTN(Button*)));
+
+	// Fast forward button
+	m_pFfwdBtn = new Button(
+			pControlsPanel,
+			"/playerControlPanel/btn_ffwd_on.png",
+			"/playerControlPanel/btn_ffwd_off.png",
+			"/playerControlPanel/btn_ffwd_over.png",
+			QSize(21, 15)
+	);
+	m_pFfwdBtn->move(92, 6);
+	m_pFfwdBtn->setToolTip( trUtf8("Fast Forward") );
+	connect(m_pFfwdBtn, SIGNAL(clicked(Button*)), this, SLOT(ffWDBtnClicked(Button*)));
+
+
+
+
+
+
 #ifdef WIN32
 	QStringList headers;
 	headers << trUtf8 ( "Song list" );
@@ -72,7 +169,7 @@
 	removeFromListBTN->setEnabled ( false );
 	removeFromListBTN->setEnabled ( false );
 	saveListBTN->setEnabled ( false );
-	nodePlayBTN->setEnabled ( false );
+	saveListAsBTN->setEnabled ( false );
 	loadScriptBTN->hide();
 	removeScriptBTN->hide();
 	editScriptBTN->hide();
@@ -93,16 +190,6 @@
 	m_pPlaylistTree->header()->resizeSection ( 2, 15 );
 	m_pPlaylistTree->setAlternatingRowColors( true );
 
-	addSongBTN->setEnabled ( true );
-	loadListBTN->setEnabled ( true );
-	removeFromListBTN->setEnabled ( false );
-	removeFromListBTN->setEnabled ( false );
-	saveListBTN->setEnabled ( false );
-	nodePlayBTN->setEnabled ( false );
-	loadScriptBTN->setEnabled ( false );
-	removeScriptBTN->setEnabled ( false );
-	editScriptBTN->setEnabled ( false );
-	clearPlBTN->setEnabled ( false );
 
 	QVBoxLayout *sideBarLayout = new QVBoxLayout(sideBarWidget);
 	sideBarLayout->setSpacing(0);
@@ -150,15 +237,8 @@
 				m_pPlaylistItem->setCheckState( 2, Qt::Unchecked );
 			}
 		}
-		removeFromListBTN->setEnabled ( true );
-		removeFromListBTN->setEnabled ( true );
-		saveListBTN->setEnabled ( true );
-		nodePlayBTN->setEnabled ( true );
-		loadScriptBTN->setEnabled ( true );
-		removeScriptBTN->setEnabled ( true );
-		editScriptBTN->setEnabled ( true );
-		clearPlBTN->setEnabled ( true );
 
+
 		//restore the selected item		
 		int selected = Playlist::get_instance()->getActiveSongNumber();
 		int Selected = Playlist::get_instance()->getSelectedSongNr();
@@ -191,7 +271,7 @@
 }
 
 
-void PlaylistDialog::on_addSongBTN_clicked()
+void PlaylistDialog::addSong()
 {
 	static QString songDir = Preferences::get_instance()->getDataDirectory()  + "/songs";;
 
@@ -211,8 +291,23 @@
 
 }
 
+void PlaylistDialog::addCurrentSong()
+{
+	Song *song = Hydrogen::get_instance()->getSong();
+	QString filename = song->get_filename();
+	
 
-void PlaylistDialog::on_removeFromListBTN_clicked()
+	if (filename == "") {
+		// just in case!
+		QMessageBox::information ( this, "Hydrogen", trUtf8 ( "Pleas save your song first" ));
+		return;
+	}
+//	filename += ".h2song";
+	updatePlayListNode ( filename );
+}
+
+
+void PlaylistDialog::removeFromList()
 {
 
 	QTreeWidget* m_pPlaylist = m_pPlaylistTree;
@@ -231,12 +326,8 @@
 			Hydrogen::get_instance()->m_PlayList.clear();
 			Playlist::get_instance()->setSelectedSongNr( -1 );
 			Playlist::get_instance()->setActiveSongNumber( -1 );
-			editScriptBTN->setEnabled ( false );
-			nodePlayBTN->setEnabled ( false );
-			removeFromListBTN->setEnabled ( false );
-			saveListBTN->setEnabled ( false );
-			loadScriptBTN->setEnabled ( false );
-			clearPlBTN->setEnabled ( false );
+			Playlist::get_instance()->__playlistName = "";
+			setWindowTitle ( trUtf8 ( "Play List Browser" ) );
 			return;
 		}else
 		{	
@@ -254,7 +345,7 @@
 }
 
 
-void PlaylistDialog::on_clearPlBTN_clicked()
+void PlaylistDialog::clearPlaylist()
 {
 	QTreeWidget* m_pPlaylist = m_pPlaylistTree;
 	
@@ -262,12 +353,8 @@
 	Hydrogen::get_instance()->m_PlayList.clear();
 	Playlist::get_instance()->setSelectedSongNr( -1 );
 	Playlist::get_instance()->setActiveSongNumber( -1 );
-	editScriptBTN->setEnabled ( false );
-	nodePlayBTN->setEnabled ( false );
-	removeFromListBTN->setEnabled ( false );
-	saveListBTN->setEnabled ( false );
-	loadScriptBTN->setEnabled ( false );
-	clearPlBTN->setEnabled ( false );
+	Playlist::get_instance()->__playlistName = "";
+	setWindowTitle ( trUtf8 ( "Play List Browser" ) );
 	return;	
 }
 
@@ -281,11 +368,6 @@
 	m_pPlaylistItem->setCheckState( 2, Qt::Unchecked );
 
 	updatePlayListVector();
-	loadScriptBTN->setEnabled ( true );
-	nodePlayBTN->setEnabled ( true );
-	removeFromListBTN->setEnabled ( true );
-	saveListBTN->setEnabled ( true );
-	clearPlBTN->setEnabled ( true );
 
 	QTreeWidget* m_pPlaylist = m_pPlaylistTree;
 	m_pPlaylist->setCurrentItem ( m_pPlaylistItem );
@@ -293,7 +375,7 @@
 }
 
 
-void PlaylistDialog::on_loadListBTN_clicked()
+void PlaylistDialog::loadList()
 {
 
 	static QString sDirectory =  Preferences::get_instance()->getDataDirectory()  + "playlists/" ;
@@ -330,26 +412,19 @@
 					m_pPlaylistItem->setCheckState( 2, Qt::Unchecked );
 				}
 			}
-			removeFromListBTN->setEnabled ( true );
-			removeFromListBTN->setEnabled ( true );
-			saveListBTN->setEnabled ( true );
-			nodePlayBTN->setEnabled ( true );
-			loadScriptBTN->setEnabled ( true );
-			removeScriptBTN->setEnabled ( true );
-			editScriptBTN->setEnabled ( true );
-			clearPlBTN->setEnabled ( true );
-	
 
 			QTreeWidgetItem* m_pPlaylistItem = m_pPlaylist->topLevelItem ( 0 );
 			m_pPlaylist->setCurrentItem ( m_pPlaylistItem );
 			Playlist::get_instance()->setSelectedSongNr( 0 );
+			Playlist::get_instance()->__playlistName = filename;
+			setWindowTitle ( trUtf8 ( "Play List Browser" ) + QString(" ") +  QString("- ") + QString( Playlist::get_instance()->__playlistName  ) );
 		}
 
 	}
 }
 
 
-void PlaylistDialog::on_newScriptBTN_clicked()
+void PlaylistDialog::newScript()
 {
 
 	Preferences *pPref = Preferences::get_instance();
@@ -377,19 +452,26 @@
 	{
 		return;
 	}
+
+	if( filename.contains(" ", Qt::CaseInsensitive)){
+		QMessageBox::information ( this, "Hydrogen", trUtf8 ( "Script name or path to the script contains whitespaces.\nIMPORTANT\nThe path to the script and the scriptname must without whitespaces.") );
+		return;
+	}
 	
-	std::string name = filename.toStdString();
 
-	char *file;
-	file = new char[name.length() + 1];
-	strcpy(file, name.c_str());
+	QFile chngPerm ( filename );
+	if (!chngPerm.open(QIODevice::WriteOnly | QIODevice::Text))
+		return;
 
-	ofstream newfile;
-	newfile.open ( file );
-	newfile << "#!/bin/sh\n\n#have phun";
-	newfile.close();
-	delete [] file;
+	QTextStream out(&chngPerm);
+	out <<  "#!/bin/sh\n\n#have phun";
+	chngPerm.close();
 
+
+	if (chngPerm.exists() ) {
+		chngPerm.setPermissions( QFile::ReadOwner|QFile::WriteOwner|QFile::ExeOwner );
+		QMessageBox::information ( this, "Hydrogen", trUtf8 ( "WARNING, the new file is executable by the owner of the file!" ) );
+	}
 	
 	if( pPref->getDefaultEditor() == ""){
 		QMessageBox::information ( this, "Hydrogen", trUtf8 ( "No Default Editor Set. Please set your Default Editor\nDo not use a console based Editor\nSorry, but this will not work for the moment." ) );
@@ -410,11 +492,11 @@
 		}		
 	}
 
-	std::string  openfile = pPref->getDefaultEditor().toStdString() + " " + filename.toStdString() + "&";
+	QString  openfile = pPref->getDefaultEditor() + " " + filename + "&";
 
 	char *ofile;
 	ofile = new char[openfile.length() + 1];
-	strcpy(ofile, openfile.c_str());
+	strcpy(ofile, openfile.toAscii());
 	std::system( ofile ); 
 	delete [] ofile;
 	return;
@@ -423,7 +505,7 @@
 }
 
 
-void PlaylistDialog::on_saveListBTN_clicked()
+void PlaylistDialog::saveListAs()
 {
 
 	QString sDirectory =  Preferences::get_instance()->getDataDirectory()  + "playlists/";
@@ -446,18 +528,42 @@
 	if ( fd->exec() == QDialog::Accepted )
 	{
 		filename = fd->selectedFiles().first();
+	}else
+	{
+		return;
 	}
 
 	LocalFileMng fileMng;
 	int err = fileMng.savePlayList( filename.toStdString() );
 	if ( err != 0 ) {
 		_ERRORLOG( "Error saving the playlist" );
+	}else
+	{
+		Playlist::get_instance()->__playlistName = filename;
+		setWindowTitle ( trUtf8 ( "Play List Browser" ) + QString(" ") +  QString("- ") + QString( Playlist::get_instance()->__playlistName  ) );
 	}
 }
 
 
-void PlaylistDialog::on_loadScriptBTN_clicked()
+void PlaylistDialog::saveList()
 {
+
+	if ( Playlist::get_instance()->__playlistName == "") {
+		// just in case!
+		return saveListAs();
+	}
+
+	LocalFileMng fileMng;
+	int err = fileMng.savePlayList( Playlist::get_instance()->__playlistName.toStdString() );
+	if ( err != 0 ) {
+		_ERRORLOG( "Error saving the playlist" );
+	}
+
+}
+
+
+void PlaylistDialog::loadScript()
+{
 	
 	QTreeWidgetItem* m_pPlaylistItem = m_pPlaylistTree->currentItem();
 	if ( m_pPlaylistItem == NULL ){
@@ -476,24 +582,21 @@
 	QString filename = "";
 	if ( fd->exec() == QDialog::Accepted ){
 		filename = fd->selectedFiles().first();
+//		filename = filename.simplified();
 
-		std::string filetest = filename.toStdString();
-		int error = filetest.rfind(" ");
-		if(error >= 0){
+		if( filename.contains(" ", Qt::CaseInsensitive)){
 			QMessageBox::information ( this, "Hydrogen", trUtf8 ( "Script name or path to the script contains whitespaces.\nIMPORTANT\nThe path to the script and the scriptname must without whitespaces.") );
 			return;
 		}
 
 		m_pPlaylistItem->setText ( 1, filename );
-		editScriptBTN->setEnabled ( true );
-		removeScriptBTN->setEnabled ( true );
 		updatePlayListVector();
 
 	}
 }
 
 
-void PlaylistDialog::on_removeScriptBTN_clicked()
+void PlaylistDialog::removeScript()
 {
 	QTreeWidgetItem* m_pPlaylistItem = m_pPlaylistTree->currentItem();
 
@@ -518,7 +621,7 @@
 }
 
 
-void PlaylistDialog::on_editScriptBTN_clicked()
+void PlaylistDialog::editScript()
 {
 	Preferences *pPref = Preferences::get_instance();
 	if( pPref->getDefaultEditor() == ""){
@@ -549,7 +652,7 @@
 	QString selected = "";
 	selected = m_pPlaylistItem->text ( 1 );
 
-	std::string filename = pPref->getDefaultEditor().toStdString() + " " + selected.toStdString() + "&";
+	QString filename = pPref->getDefaultEditor() + " " + selected + "&";
 
 	if( selected == "no Script"){
 		QMessageBox::information ( this, "Hydrogen", trUtf8 ( "No Script selected!" ));
@@ -558,10 +661,11 @@
 
 	char *file;
 	file = new char[ filename.length() + 1 ];
-	strcpy( file , filename.c_str() );
+	strcpy( file , filename.toAscii() );
 	std::system( file ); 
 	delete [] file;
 	return;
+
 }
 
 
@@ -650,46 +754,78 @@
 }
 
 
-void PlaylistDialog::on_nodePlayBTN_clicked()
+void PlaylistDialog::nodePlayBTN( Button* ref )
 {
-	QTreeWidgetItem* m_pPlaylistItem = m_pPlaylistTree->currentItem();
-	if ( m_pPlaylistItem == NULL ){
-		QMessageBox::information ( this, "Hydrogen", trUtf8 ( "No Song selected!" ) );
-		return;
-	}
-	QString selected = "";
-	selected = m_pPlaylistItem->text ( 0 );
+	Hydrogen *engine = Hydrogen::get_instance();
+	HydrogenApp *pH2App = HydrogenApp::get_instance();
 
+	if (ref->isPressed()) {
+		QTreeWidgetItem* m_pPlaylistItem = m_pPlaylistTree->currentItem();
+		if ( m_pPlaylistItem == NULL ){
+			QMessageBox::information ( this, "Hydrogen", trUtf8 ( "No Song selected!" ) );
+			m_pPlayBtn->setPressed(false);
+			return;
+		}
+		QString selected = "";
+		selected = m_pPlaylistItem->text ( 0 );
+
+		if( selected == engine->getSong()->get_filename()){
+			engine->sequencer_play();
+			return;	
+		}		
 	
-	HydrogenApp *pH2App = HydrogenApp::get_instance();
-	Hydrogen *engine = Hydrogen::get_instance();
+		if ( engine->getState() == STATE_PLAYING ){
+			engine->sequencer_stop();
+		}
 	
+		LocalFileMng mng;
+		Song *pSong = Song::load ( selected );
+		if ( pSong == NULL ){
+			QMessageBox::information ( this, "Hydrogen", trUtf8 ( "Error loading song." ) );
+			m_pPlayBtn->setPressed(false);
+			return;
+		}
 
-	if ( engine->getState() == STATE_PLAYING ){
+		QTreeWidget* m_pPlaylist = m_pPlaylistTree;
+		int index = m_pPlaylist->indexOfTopLevelItem ( m_pPlaylistItem );
+		Playlist::get_instance()->setActiveSongNumber( index );
+	
+		pH2App->setSong ( pSong );
+		engine->setSelectedPatternNumber ( 0 );
+	
+		engine->sequencer_play();
+	}else 
+	{
 		engine->sequencer_stop();
+		pH2App->setStatusBarMessage(trUtf8("Pause."), 5000);
 	}
+}
 
-	LocalFileMng mng;
-	Song *pSong = Song::load ( selected );
-	if ( pSong == NULL ){
-		QMessageBox::information ( this, "Hydrogen", trUtf8 ( "Error loading song." ) );
-		return;
-	}
 
-	pH2App->setSong ( pSong );
-	engine->setSelectedPatternNumber ( 0 );
+void PlaylistDialog::nodeStopBTN( Button* ref )
+{
+	UNUSED( ref );
+	m_pPlayBtn->setPressed(false);
+	Hydrogen::get_instance()->sequencer_stop();
+	Hydrogen::get_instance()->setPatternPos ( 0 );
+}
 
-	Hydrogen::get_instance()->sequencer_play();
+
+void PlaylistDialog::ffWDBtnClicked( Button* ref)
+{
+	UNUSED( ref );
+	Hydrogen *pEngine = Hydrogen::get_instance();
+	pEngine->setPatternPos( pEngine->getPatternPos() + 1 );
 }
 
 
-void PlaylistDialog::on_nodeStopBTN_clicked()
+void PlaylistDialog::rewindBtnClicked( Button* ref )
 {
-	Hydrogen::get_instance()->sequencer_stop();
-	Hydrogen::get_instance()->setPatternPos ( 0 );
+	UNUSED( ref );
+	Hydrogen *pEngine = Hydrogen::get_instance();
+	pEngine->setPatternPos( pEngine->getPatternPos() - 1 );
 }
 
-
 void PlaylistDialog::on_m_pPlaylistTree_itemDoubleClicked ()
 {
 
@@ -714,6 +850,8 @@
 		engine->sequencer_stop();
 	}
 
+	m_pPlayBtn->setPressed(false);
+
 	LocalFileMng mng;
 	Song *pSong = Song::load ( selected );
 	if ( pSong == NULL ){
@@ -738,7 +876,6 @@
 	QString execscript = "";
 	selected = m_pPlaylistItem->text ( 1 );
 	bool execcheckbox = m_pPlaylistItem->checkState ( 2 );
-	std::string filename = selected.toStdString();
 
 	if( execcheckbox == false){
 		//QMessageBox::information ( this, "Hydrogen", trUtf8 ( "No Script selected!" ));
@@ -751,8 +888,8 @@
 	}
 
 	char *file;
-	file = new char[ filename.length() + 1 ];
-	strcpy( file , filename.c_str() );
+	file = new char[ selected.length() + 1 ];
+	strcpy( file , selected.toAscii() );
 	std::system( file ); 
 	delete [] file;
 	return;
Index: gui/src/PlaylistEditor/PlaylistDialog.h
===================================================================
--- gui/src/PlaylistEditor/PlaylistDialog.h	(Revision 1331)
+++ gui/src/PlaylistEditor/PlaylistDialog.h	(Arbeitskopie)
@@ -34,6 +34,8 @@
 
 
 class Button;
+class ToggleButton;
+class PixmapWidget;
 
 ///
 /// This dialog is used to use the H2PlayList
@@ -50,17 +52,21 @@
 
 
 	private slots:
-		void on_addSongBTN_clicked();
-		void on_removeFromListBTN_clicked();
-		void on_removeScriptBTN_clicked();
-		void on_clearPlBTN_clicked();
-		void on_loadListBTN_clicked();
-		void on_saveListBTN_clicked();
-		void on_loadScriptBTN_clicked();
-		void on_nodePlayBTN_clicked();
-		void on_nodeStopBTN_clicked();
-		void on_editScriptBTN_clicked();
-		void on_newScriptBTN_clicked();
+		void addSong();
+		void addCurrentSong();
+		void removeFromList();
+		void removeScript();
+		void clearPlaylist();
+		void loadList();
+		void saveListAs();
+		void saveList();
+		void loadScript();
+		void ffWDBtnClicked(Button* ref);
+		void nodePlayBTN( Button* ref );
+		void nodeStopBTN( Button* ref );
+		void rewindBtnClicked(Button *ref);
+		void editScript();
+		void newScript();
 		void on_m_pPlaylistTree_itemClicked ( QTreeWidgetItem * item, int column );
 		void o_upBClicked();
 		void o_downBClicked();
@@ -76,6 +82,11 @@
 		void setFirstItemCurrent();
 		Button *zoom_in_btn;
 		QTimer *timer;
+
+		Button *m_pRwdBtn;
+		ToggleButton *m_pPlayBtn;
+		Button *m_pStopBtn;
+		Button *m_pFfwdBtn;
 };
 
 
Index: gui/src/PlaylistEditor/PlaylistDialog_UI.ui
===================================================================
--- gui/src/PlaylistEditor/PlaylistDialog_UI.ui	(Revision 1331)
+++ gui/src/PlaylistEditor/PlaylistDialog_UI.ui	(Arbeitskopie)
@@ -1,7 +1,8 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
  <class>PlaylistDialog_UI</class>
- <widget class="QDialog" name="PlaylistDialog_UI" >
-  <property name="geometry" >
+ <widget class="QDialog" name="PlaylistDialog_UI">
+  <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
@@ -9,234 +10,89 @@
     <height>393</height>
    </rect>
   </property>
-  <property name="windowTitle" >
+  <property name="windowTitle">
    <string>PlayList Browser</string>
   </property>
-  <widget class="QWidget" name="layoutWidget_1" >
-   <property name="geometry" >
+  <widget class="QTreeWidget" name="m_pPlaylistTree">
+   <property name="geometry">
     <rect>
-     <x>11</x>
-     <y>13</y>
-     <width>921</width>
-     <height>28</height>
-    </rect>
-   </property>
-   <layout class="QHBoxLayout" name="horizontalLayout_3" >
-    <item>
-     <widget class="QPushButton" name="addSongBTN" >
-      <property name="text" >
-       <string>Add song to playlist</string>
-      </property>
-     </widget>
-    </item>
-    <item>
-     <widget class="QPushButton" name="removeFromListBTN" >
-      <property name="text" >
-       <string>Remove song from playlist</string>
-      </property>
-     </widget>
-    </item>
-    <item>
-     <widget class="QPushButton" name="clearPlBTN" >
-      <property name="text" >
-       <string>Clear playlist</string>
-      </property>
-     </widget>
-    </item>
-    <item>
-     <spacer>
-      <property name="orientation" >
-       <enum>Qt::Horizontal</enum>
-      </property>
-      <property name="sizeHint" stdset="0" >
-       <size>
-        <width>368</width>
-        <height>23</height>
-       </size>
-      </property>
-     </spacer>
-    </item>
-    <item>
-     <widget class="QPushButton" name="loadScriptBTN" >
-      <property name="text" >
-       <string>Load script</string>
-      </property>
-     </widget>
-    </item>
-    <item>
-     <widget class="QPushButton" name="removeScriptBTN" >
-      <property name="text" >
-       <string>Remove script</string>
-      </property>
-     </widget>
-    </item>
-   </layout>
-  </widget>
-  <widget class="QTreeWidget" name="m_pPlaylistTree" >
-   <property name="geometry" >
-    <rect>
      <x>12</x>
-     <y>48</y>
+     <y>29</y>
      <width>921</width>
-     <height>292</height>
+     <height>321</height>
     </rect>
    </property>
-   <property name="minimumSize" >
+   <property name="minimumSize">
     <size>
      <width>0</width>
      <height>271</height>
     </size>
    </property>
-   <property name="acceptDrops" >
+   <property name="acceptDrops">
     <bool>false</bool>
    </property>
-   <property name="verticalScrollBarPolicy" >
+   <property name="verticalScrollBarPolicy">
     <enum>Qt::ScrollBarAsNeeded</enum>
    </property>
-   <property name="horizontalScrollBarPolicy" >
+   <property name="horizontalScrollBarPolicy">
     <enum>Qt::ScrollBarAsNeeded</enum>
    </property>
-   <property name="tabKeyNavigation" >
+   <property name="tabKeyNavigation">
     <bool>true</bool>
    </property>
-   <property name="showDropIndicator" stdset="0" >
+   <property name="showDropIndicator" stdset="0">
     <bool>false</bool>
    </property>
-   <property name="dragEnabled" >
+   <property name="dragEnabled">
     <bool>false</bool>
    </property>
-   <property name="dragDropOverwriteMode" >
+   <property name="dragDropOverwriteMode">
     <bool>false</bool>
    </property>
-   <property name="dragDropMode" >
+   <property name="dragDropMode">
     <enum>QAbstractItemView::NoDragDrop</enum>
    </property>
-   <property name="rootIsDecorated" >
+   <property name="rootIsDecorated">
     <bool>true</bool>
    </property>
-   <property name="uniformRowHeights" >
+   <property name="uniformRowHeights">
     <bool>true</bool>
    </property>
-   <property name="itemsExpandable" >
+   <property name="itemsExpandable">
     <bool>false</bool>
    </property>
-   <property name="sortingEnabled" >
+   <property name="sortingEnabled">
     <bool>false</bool>
    </property>
-   <property name="move" stdset="0" >
+   <property name="move" stdset="0">
     <stringlist/>
    </property>
    <column>
-    <property name="text" >
+    <property name="text">
      <string>Song list</string>
     </property>
    </column>
   </widget>
-  <widget class="QWidget" native="1" name="sideBarWidget" >
-   <property name="geometry" >
+  <widget class="QWidget" name="sideBarWidget" native="true">
+   <property name="geometry">
     <rect>
-     <x>939</x>
-     <y>48</y>
+     <x>940</x>
+     <y>30</y>
      <width>16</width>
-     <height>292</height>
+     <height>311</height>
     </rect>
    </property>
   </widget>
-  <widget class="QWidget" name="layoutWidget_2" >
-   <property name="geometry" >
+  <widget class="QWidget" name="verticalLayoutWidget">
+   <property name="geometry">
     <rect>
      <x>10</x>
      <y>350</y>
-     <width>921</width>
-     <height>32</height>
+     <width>301</width>
+     <height>41</height>
     </rect>
    </property>
-   <layout class="QHBoxLayout" name="horizontalLayout_6" >
-    <item>
-     <layout class="QHBoxLayout" name="horizontalLayout_5" >
-      <item>
-       <layout class="QHBoxLayout" name="horizontalLayout_2" >
-        <item>
-         <widget class="QPushButton" name="loadListBTN" >
-          <property name="text" >
-           <string>Load list</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QPushButton" name="saveListBTN" >
-          <property name="text" >
-           <string>Save list</string>
-          </property>
-         </widget>
-        </item>
-       </layout>
-      </item>
-      <item>
-       <spacer name="horizontalSpacer" >
-        <property name="orientation" >
-         <enum>Qt::Horizontal</enum>
-        </property>
-        <property name="sizeHint" stdset="0" >
-         <size>
-          <width>40</width>
-          <height>20</height>
-         </size>
-        </property>
-       </spacer>
-      </item>
-      <item>
-       <layout class="QHBoxLayout" name="horizontalLayout" >
-        <item>
-         <widget class="QPushButton" name="nodePlayBTN" >
-          <property name="text" >
-           <string>Play selected</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QPushButton" name="nodeStopBTN" >
-          <property name="text" >
-           <string>Stop</string>
-          </property>
-         </widget>
-        </item>
-       </layout>
-      </item>
-     </layout>
-    </item>
-    <item>
-     <spacer name="horizontalSpacer_2" >
-      <property name="orientation" >
-       <enum>Qt::Horizontal</enum>
-      </property>
-      <property name="sizeHint" stdset="0" >
-       <size>
-        <width>318</width>
-        <height>20</height>
-       </size>
-      </property>
-     </spacer>
-    </item>
-    <item>
-     <layout class="QHBoxLayout" name="horizontalLayout_4" >
-      <item>
-       <widget class="QPushButton" name="newScriptBTN" >
-        <property name="text" >
-         <string>New Script</string>
-        </property>
-       </widget>
-      </item>
-      <item>
-       <widget class="QPushButton" name="editScriptBTN" >
-        <property name="text" >
-         <string>Edit script</string>
-        </property>
-       </widget>
-      </item>
-     </layout>
-    </item>
-   </layout>
+   <layout class="QVBoxLayout" name="playerControl"/>
   </widget>
  </widget>
  <resources/>
Index: libs/hydrogen/include/hydrogen/playlist.h
===================================================================
--- libs/hydrogen/include/hydrogen/playlist.h	(Revision 1331)
+++ libs/hydrogen/include/hydrogen/playlist.h	(Arbeitskopie)
@@ -56,12 +56,13 @@
 
 		int selectedSongNumber;
 		
-
 		int getSelectedSongNr();
 		void setActiveSongNumber( int ActiveSongNumber);
 		int getActiveSongNumber();
 
+		QString __playlistName;
 
+
 	private:
 
 		static Playlist* __instance;
Index: libs/hydrogen/src/playlist.cpp
===================================================================
--- libs/hydrogen/src/playlist.cpp	(Revision 1331)
+++ libs/hydrogen/src/playlist.cpp	(Arbeitskopie)
@@ -54,6 +54,7 @@
 
 	//_INFOLOG( "[Playlist]" );
 	__instance = this;
+	__playlistName = "";
 
 }
 
Index: data/img/gray/playerControlPanel/playlist_background_Control.png
===================================================================
Kann nicht anzeigen: Dateityp ist als binär angegeben.
svn:mime-type = application/octet-stream

Eigenschaftsänderungen: data/img/gray/playerControlPanel/playlist_background_Control.png
___________________________________________________________________
Hinzugefügt: svn:mime-type
   + application/octet-stream

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Hydrogen-devel mailing list
Hydrogen-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hydrogen-devel

Reply via email to