From 42a4be7a34a8e380b91c7ce5165728985282fc63 Mon Sep 17 00:00:00 2001 From: flykhan Date: Thu, 31 Aug 2023 15:03:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=9D=E5=A7=8B=E6=AD=8C?= =?UTF-8?q?=E6=9B=B2=EF=BC=8C=E4=BF=AE=E6=94=B9=E9=9F=B3=E9=87=8F=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mainwindow.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 479c7f0..66c9046 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -85,7 +85,7 @@ void MainWindow::mplayerInit() dup2(fd[1], 1); // 使用 exec 启动 mplayer // execlp("mplayer","mplayer","-idle","-slave","-quiet","/home/flykhan/qtmplayer/song/StopLove.mp3",NULL); - execlp("/usr/bin/mplayer","mplayer","-idle","-slave","-quiet","-input","file=fifo_cmd","/home/flykhan/qtmplayer/song/StopLove.mp3",NULL); + execlp("/usr/bin/mplayer","mplayer","-idle","-slave","-quiet","-input","file=fifo_cmd","/home/flykhan/qtmplayer/song/Diamonds.mp3",NULL); _exit(-1); // 异常退出 } else if(pid>0) // 父进程 @@ -307,7 +307,7 @@ void MainWindow::player_rewind_or_forward(int seconds) void MainWindow::volume_control(int value) { char changeSongBuf[128] = ""; - int len = sprintf(changeSongBuf, "volume %d 1\n", value); // 音量调整到 value 大小 + int len = sprintf(changeSongBuf, "volume %d\n", value); // 音量调整到 value 大小 write(this->fifo_fd, changeSongBuf, len); // 将音量控制指令写入到有名管道中 } @@ -332,24 +332,24 @@ void MainWindow::on_mute_btn_clicked() { if(mute_flag == 0) // 没静音则按下后设置静音 { - ui->play_btn->setIcon(QIcon(":/icon/mute2")); + ui->mute_btn->setIcon(QIcon(":/icon/mute1")); // volume_mute_switch(1); // mute_flag = 1; volume_mute_switch(++mute_flag); } else if (mute_flag == 1) // 已静音则按下后取消静音 { - ui->play_btn->setIcon(QIcon(":/icon/mute1")); + ui->mute_btn->setIcon(QIcon(":/icon/mute2")); volume_mute_switch(--mute_flag); } } void MainWindow::on_volume_down_btn_clicked() { - volume_control(-5); // 减 5 音量 + volume_control(-10); // 减 10 音量 } void MainWindow::on_volume_up_btn_clicked() { - volume_control(5); // 加 5 音量 + volume_control(10); // 加 10 音量 }