Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
giacomogroppi committed Dec 9, 2020
1 parent 59f3788 commit 9419149
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/audioplay/enableriascolto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
/* la funzione gestisce la gestione del click del punsante con la mano */
void MainWindow::on_actionListen_current_audio_triggered()
{
/*int i;
for(i= 0; i<this->self->currenttitle.testinohtml.length(); i++ )
qDebug() << this->self->currenttitle.testinohtml.at(i);*/

if(this->player->state() == QMediaPlayer::PlayingState || this->player->mediaStatus() == QMediaPlayer::EndOfMedia){
settingaudio_riascoltoinatto(this, false);

Expand Down
10 changes: 10 additions & 0 deletions src/audioplay/slidertimechange.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include "../mainwindow.h"
#include "ui_mainwindow.h"

#include <QDebug>

void MainWindow::on_audioSlider_valueChanged(int value)
{
qDebug() << "Duretion change " << value;
this->player->setPosition(value*1000);
}
7 changes: 7 additions & 0 deletions src/audioplay/valuechangeslidervolume.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include "../mainwindow.h"
#include "ui_mainwindow.h"

void MainWindow::on_volumeSlider_valueChanged(int value)
{
this->player->setVolume(value);
}
5 changes: 2 additions & 3 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,8 @@ void MainWindow::processBuffer(const QAudioBuffer& buffer)
/* editor di testo -> quando cambia il testo scritto */
void MainWindow::on_textEdit_textChanged()
{
if(this->player->state() == QMediaPlayer::PlayingState || this->player->state() == QMediaPlayer::PausedState)
/* se non sta registrando deve uscire */
if(this->m_audioRecorder->state() != QMediaRecorder::RecordingState)
return;
this->self->currenttitle.testi = this->ui->textEdit->toHtml();

Expand Down Expand Up @@ -444,5 +445,3 @@ void MainWindow::on_fontComboBox_fonttipo_currentFontChanged(const QFont &f)
{
this->ui->textEdit->setCurrentFont(f);
}


4 changes: 4 additions & 0 deletions src/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ private slots:
void on_actionPrint_triggered();


void on_audioSlider_valueChanged(int value);

void on_volumeSlider_valueChanged(int value);

private:
/* gestione dell'audio */
void clearAudioLevels();
Expand Down
12 changes: 12 additions & 0 deletions src/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,18 @@
</item>
<item>
<widget class="QSlider" name="volumeSlider">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>180</width>
<height>16777215</height>
</size>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
Expand Down
3 changes: 3 additions & 0 deletions src/setting_ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ void settingaudio_riascoltoinatto(MainWindow *parent, bool check){

/*Funzione che gestisce l'aggiunta della barra per selezionare il font*/
void setting_ui_start(MainWindow *parent){
parent->ui->volumeSlider->setMaximum(100);
parent->ui->volumeSlider->setMinimum(0);

parent->setWindowTitle("Writernote");

settingaudio_registrazione(parent, false);
Expand Down
2 changes: 2 additions & 0 deletions writernote.pro
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ SOURCES += \
src/audioplay/enableriascolto.cpp \
src/audioplay/playbottonfunction.cpp \
src/audioplay/riascoltoaudioprogressivo.cpp \
src/audioplay/slidertimechange.cpp \
src/audioplay/updatestatusbar_riascolto.cpp \
src/audioplay/valuechangeslidervolume.cpp \
src/audiosetting/audioqualityoption.cpp \
src/audiorecord/displayErrorMessage.cpp \
src/audiorecord/getbufferlevels.cpp \
Expand Down

0 comments on commit 9419149

Please sign in to comment.