author | harlekin <harlekin> | 2002-07-03 14:44:22 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-07-03 14:44:22 (UTC) |
commit | e1e4956ec7ffa9a07f98b03e831f0f9627556a6c (patch) (unidiff) | |
tree | c0545c6a22732f05804bda7704227132f64b7239 /noncore/multimedia/opieplayer2/mediaplayer.cpp | |
parent | 61770de77f2abe8012d44cce49d04489e4187644 (diff) | |
download | opie-e1e4956ec7ffa9a07f98b03e831f0f9627556a6c.zip opie-e1e4956ec7ffa9a07f98b03e831f0f9627556a6c.tar.gz opie-e1e4956ec7ffa9a07f98b03e831f0f9627556a6c.tar.bz2 |
much more code cleanup, make if look more like c++ code
Diffstat (limited to 'noncore/multimedia/opieplayer2/mediaplayer.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayer.cpp | 52 |
1 files changed, 6 insertions, 46 deletions
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp index e6d0525..87184ba 100644 --- a/noncore/multimedia/opieplayer2/mediaplayer.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp | |||
@@ -57,3 +57,2 @@ void MediaPlayer::setPlaying( bool play ) { | |||
57 | mediaPlayerState->setPaused( FALSE ); | 57 | mediaPlayerState->setPaused( FALSE ); |
58 | // loopControl->stop( FALSE ); | ||
59 | return; | 58 | return; |
@@ -68,3 +67,2 @@ void MediaPlayer::setPlaying( bool play ) { | |||
68 | if ( playListCurrent != NULL ) { | 67 | if ( playListCurrent != NULL ) { |
69 | // loopControl->stop( TRUE ); | ||
70 | currentFile = playListCurrent; | 68 | currentFile = playListCurrent; |
@@ -72,49 +70,11 @@ void MediaPlayer::setPlaying( bool play ) { | |||
72 | 70 | ||
73 | /* | 71 | audioUI->setTickerText( currentFile->file() ); |
74 | 72 | ||
75 | if ( currentFile == NULL ) { | ||
76 | QMessageBox::critical( 0, tr( "No file"), tr( "Error: There is no file selected" ) ); | ||
77 | mediaPlayerState->setPlaying( FALSE ); | ||
78 | return; | ||
79 | } | ||
80 | |||
81 | if ( ((currentFile->file()).left(4) != "http") && !QFile::exists( currentFile->file() ) ) { | ||
82 | QMessageBox::critical( 0, tr( "File not found"), tr( "The following file was not found: <i>" ) + currentFile->file() + "</i>" ); | ||
83 | mediaPlayerState->setPlaying( FALSE ); | ||
84 | return; | ||
85 | } | ||
86 | |||
87 | if ( !mediaPlayerState->newDecoder( currentFile->file() ) ) { | ||
88 | QMessageBox::critical( 0, tr( "No decoder found"), tr( "Sorry, no appropriate decoders found for this file: <i>" ) + currentFile->file() + "</i>" ); | ||
89 | mediaPlayerState->setPlaying( FALSE ); | ||
90 | return; | ||
91 | } | ||
92 | |||
93 | // if ( !loopControl->init( currentFile->file() ) ) { | ||
94 | // QMessageBox::critical( 0, tr( "Error opening file"), tr( "Sorry, an error occured trying to play the file: <i>" ) + currentFile->file() + "</i>" ); | ||
95 | // mediaPlayerState->setPlaying( FALSE ); | ||
96 | // return; | ||
97 | // } | ||
98 | // long seconds = loopControl->totalPlaytime(); | ||
99 | long seconds = 120; | ||
100 | QString time; | ||
101 | time.sprintf("%li:%02i", seconds/60, (int)seconds%60 ); | ||
102 | QString tickerText; | ||
103 | if( currentFile->file().left(4) == "http" ) | ||
104 | tickerText= tr( " File: " ) + currentFile->name(); | ||
105 | else | ||
106 | tickerText = tr( " File: " ) + currentFile->name() + tr(", Length: ") + time; | ||
107 | |||
108 | QString fileInfo = mediaPlayerState->curDecoder()->fileInfo(); | ||
109 | if ( !fileInfo.isEmpty() ) | ||
110 | tickerText += ", " + fileInfo; | ||
111 | audioUI->setTickerText( tickerText + "." ); | ||
112 | |||
113 | |||
114 | */ // alles nicht nötig, xine kümmert sich drum, man muss nur den return andio oder video gui geben | ||
115 | 73 | ||
74 | // alles nicht nötig, xine kümmert sich drum, man muss nur den return andio oder video gui geben | ||
116 | 75 | ||
117 | // loopControl->play(); | 76 | // Ob auch video 'v' : 'a' |
77 | // mediaPlayerState->setView( 'v' ); | ||
118 | 78 | ||
119 | // mediaPlayerState->setView( loopControl->hasVideo() ? 'v' : 'a' ); | 79 | // abspielen starten. |
120 | } | 80 | } |
@@ -147,3 +107,3 @@ void MediaPlayer::startDecreasingVolume() { | |||
147 | startTimer( 100 ); | 107 | startTimer( 100 ); |
148 | // sollte volumeapplet machen | 108 | // da kommt demnächst osound denk ich mal |
149 | // AudioDevice::decreaseVolume(); | 109 | // AudioDevice::decreaseVolume(); |