예제 #1
0
void playerWindow::on_next_clicked_eos
(
	void
)
{
	// stop the current playback
	on_stop_clicked();	
	// set the track state
	if (playlistIsLoaded.get_active()) {
		// loop/shuffle enable or disable
		if (playlist->isShuffling()) { // shuffle bypass the loop mode
		 	// set randomly the next track
		 	playlist->randomTrack();
			// set the new track to play
			gst->setFile
			(
				playlist->getURIToPlay(),
				playlist->getNameToPlay()
			);
			// start playback
			on_play_clicked();
		 } else if 
		 (
	 		playlist->isLooping() || 
	 		(!playlist->isShuffling() && !playlist->isLastTrack())
		 ) 
		 {
			// set the next track
			playlist->nextTrack();
			// set the new track to play
			gst->setFile
			(
				playlist->getURIToPlay(),
				playlist->getNameToPlay()
			);
			// start playback
			on_play_clicked();
		 } else {
		 	// set the next track, in this case the first track but
		 	// don't play it
			playlist->nextTrack();
			// set the new track to play
			gst->setFile
			(
				playlist->getURIToPlay(),
				playlist->getNameToPlay()
			);
			// reset the timecode
			refresh_timecode();
			// disconnect the timecode's timer
			timeout_timecode.disconnect();
		 }
	}
}
예제 #2
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    sub=NULL;
    videoPlayer=new VideoPlayer(this,this);
    subtitles=new Subtitles(this,this);
    subtitles->setReadOnly(true);
    subtitles->hide();
    ui->autoris->setText("Вы не авторизировались <a href=\"aut\">Авторизироваться</a>");
    ui->logOut->setText("");
    ui->closePan->setText("<a href=\"close\"><font color=\"red\">X</font></a>");
    setLayouts();
    connect(ui->action,SIGNAL(triggered()),this,SLOT(on_open_action_click()));
    connect(ui->action_2,SIGNAL(triggered()),this,SLOT(on_exit_action()));
    connect(ui->action_3,SIGNAL(triggered()),this,SLOT(on_open_subs_click()));
    connect(ui->action_5,SIGNAL(triggered()),this,SLOT(registretion_clicked()));
    connect(ui->play,SIGNAL(clicked()),this,SLOT(on_play_clicked()));
    connect(videoPlayer,SIGNAL(on_screen_state_change(bool)),this,SLOT(on_videoplayer_change_state(bool)));
    ui->pushButton->setToolTip(tr("Добавить слово в мой словарь"));

    if(QApplication::arguments().size()>1)
      videoPlayer->play(QApplication::arguments().at(1).trimmed());

    ac=new RequestManager();
    connect(ac,SIGNAL(finish(QMap<QString,QString>,Action)),this,SLOT(dataReceive(QMap<QString,QString>,Action)));
    QTimer::singleShot(10,this,SLOT(lazyInit()));
}
예제 #3
0
void MusPlayer_WinAPI::on_recordWav_clicked(bool checked)
{
    if(checked)
    {
        PGE_MusicPlayer::MUS_stopMusic();
        SetWindowTextW(m_buttonPlay, L"Play");
        PGE_MusicPlayer::stopWavRecording();
        PGE_MusicPlayer::startWavRecording(currentMusic + ".wav");
        on_play_clicked();
        EnableWindow(m_buttonOpen, FALSE);
        EnableWindow(m_buttonPlay, FALSE);
        EnableWindow(m_gme.m_trackNum, FALSE);
        EnableWindow(m_gme.m_trackNumUpDown, FALSE);
        EnableWindow(m_midi.m_midiDevice, FALSE);
        EnableWindow(m_adlmidi.m_bankID, FALSE);
        EnableWindow(m_adlmidi.m_tremolo, FALSE);
        EnableWindow(m_adlmidi.m_vibrato, FALSE);
        EnableWindow(m_adlmidi.m_scalableMod, FALSE);
        EnableWindow(m_adlmidi.m_adlibDrums, FALSE);
    } else {
        on_stop_clicked();
        PGE_MusicPlayer::stopWavRecording();
        SetWindowTextW(m_buttonPlay, L"Play");
        EnableWindow(m_buttonOpen, TRUE);
        EnableWindow(m_buttonPlay, TRUE);
        EnableWindow(m_gme.m_trackNum, TRUE);
        EnableWindow(m_gme.m_trackNumUpDown, TRUE);
        EnableWindow(m_midi.m_midiDevice, TRUE);
        EnableWindow(m_adlmidi.m_bankID, TRUE);
        EnableWindow(m_adlmidi.m_tremolo, TRUE);
        EnableWindow(m_adlmidi.m_vibrato, TRUE);
        EnableWindow(m_adlmidi.m_scalableMod, TRUE);
        EnableWindow(m_adlmidi.m_adlibDrums, TRUE);
    }
}
예제 #4
0
void MusPlayer_WinAPI::on_open_clicked()
{
    OPENFILENAMEW open;
    memset(&open, 0, sizeof(open));

    wchar_t flnm[MAX_PATH];
    flnm[0]=L'\0';
    open.lStructSize = sizeof(OPENFILENAMEW);
    open.hInstance = m_hInstance;
    open.hwndOwner = m_hWnd;
    open.lpstrFilter = L"All files (*.*)\0*.*";
    open.lpstrDefExt = L"\0";
    open.lpstrFile = flnm;
    open.nMaxFile = MAX_PATH;
    open.lpstrTitle = L"Open music file to play...";
    open.Flags = OFN_FILEMUSTEXIST;
    if(GetOpenFileNameW(&open)==TRUE)
    {
        currentMusic = Wstr2Str(open.lpstrFile);
    } else {
        return;
    }

    Mix_HaltMusic();
    on_play_clicked();
}
예제 #5
0
void MusPlayer_WinAPI::openMusicByArg(QString musPath)
{
    BOOL waveRecorderInProcess = IsDlgButtonChecked(m_hWnd, CMD_RecordWave);
    if(waveRecorderInProcess) return;
    currentMusic=musPath;
    Mix_HaltMusic();
    on_play_clicked();
}
예제 #6
0
void MainWindow::on_open_clicked()
{
    QString file = QFileDialog::getOpenFileName(this, tr("Open music file"),
                                                 (currentMusic.isEmpty() ? QApplication::applicationDirPath() : currentMusic), "All (*.*)");
    if(file.isEmpty()) return;
    currentMusic=file;
    on_play_clicked();
}
예제 #7
0
void MainWindow::dropEvent(QDropEvent *e)
{
    this->raise();
    this->setFocus(Qt::ActiveWindowFocusReason);

    foreach (const QUrl &url, e->mimeData()->urls()) {
        const QString &fileName = url.toLocalFile();
        currentMusic=fileName;
    }
    on_play_clicked();
    this->raise();
}
예제 #8
0
void MusPlayer_WinAPI::on_trackID_editingFinished()
{
    if(Mix_PlayingMusic())
    {
        char buff[1024];
        memset(buff, 0, 1024);
        GetWindowTextA(m_gme.m_trackNum, buff, 1024);
        int trackID = atoi(buff);
        if( (PGE_MusicPlayer::type == MUS_SPC) && (m_prevTrackID != trackID) )
        {
            Mix_HaltMusic();
            on_play_clicked();
        }
    }
}
예제 #9
0
void playerWindow::on_set_new_track_clicked
(
	void
)
{
	// stop the current playback
	on_stop_clicked();	
	// set the new track to play
	gst->setFile
	(
		playlist->getURIToPlay(),
		playlist->getNameToPlay()
	);
	// start playback
	on_play_clicked();
}
예제 #10
0
void MusPlayer_WinAPI::on_mididevice_currentIndexChanged(int index)
{
    switch(index)
    {
        case 0: MIX_SetMidiDevice(MIDI_ADLMIDI);
        break;
        case 1: MIX_SetMidiDevice(MIDI_Timidity);
        break;
        case 2: MIX_SetMidiDevice(MIDI_Native);
        break;
        case 3: MIX_SetMidiDevice(MIDI_Fluidsynth);
        break;
        default: MIX_SetMidiDevice(MIDI_ADLMIDI);
        break;
    }
    if(Mix_PlayingMusic())
    {
        if(PGE_MusicPlayer::type==MUS_MID)
        {
            Mix_HaltMusic();
            on_play_clicked();
        }
    }
}
예제 #11
0
void MainWindow::on_autorisation_close(int){
    on_play_clicked();
}
예제 #12
0
void MainWindow::openMusicByArg(QString musPath)
{
    currentMusic=musPath;
    on_play_clicked();
}