diff --git a/src/engine/sidechain/enginerecord.cpp b/src/engine/sidechain/enginerecord.cpp index 359d773244b9..d951f7a2d810 100644 --- a/src/engine/sidechain/enginerecord.cpp +++ b/src/engine/sidechain/enginerecord.cpp @@ -125,16 +125,26 @@ void EngineRecord::updateFromPreferences() { bool EngineRecord::metaDataHasChanged() { + //Originally, m_iMetaDataLife was used so that getCurrentPlayingTrack was called + //less often, because it was calculating it. + //Nowadays (since Mixxx 1.11), it just accesses a map on a thread safe method. + TrackPointer pTrack = PlayerInfo::instance().getCurrentPlayingTrack(); + if (!pTrack) { + m_iMetaDataLife = kMetaDataLifeTimeout; + return false; + } + + //The counter is kept so that changes back and forth with the faders/crossfader + //(like in scratching or other effects) are not counted as multiple track changes + //in the cue file. A better solution could consist of a signal from PlayerInfo and + //a slot that decides if the changes received are valid or are to be ignored once + //the next process call comes. This could also help improve the time written in the CUE. if (m_iMetaDataLife < kMetaDataLifeTimeout) { m_iMetaDataLife++; return false; } m_iMetaDataLife = 0; - TrackPointer pTrack = PlayerInfo::instance().getCurrentPlayingTrack(); - if (!pTrack) - return false; - if (m_pCurrentTrack) { if (!pTrack->getId().isValid() || !m_pCurrentTrack->getId().isValid()) { if ((pTrack->getArtist() == m_pCurrentTrack->getArtist()) && @@ -160,6 +170,9 @@ void EngineRecord::process(const CSAMPLE* pBuffer, const int iBufferSize) { if (fileOpen()) { Event::end("EngineRecord recording"); closeFile(); // Close file and free encoder. + if (m_bCueIsEnabled) { + closeCueFile(); + } emit(isRecording(false, false)); } } else if (recordingStatus == RECORD_READY) { @@ -191,7 +204,43 @@ void EngineRecord::process(const CSAMPLE* pBuffer, const int iBufferSize) { // An error occurred. emit(isRecording(false, true)); } - } else if (recordingStatus == RECORD_ON) { + } else if (recordingStatus == RECORD_SPLIT_CONTINUE) { + if (fileOpen()) { + closeFile(); // Close file and free encoder. + if (m_bCueIsEnabled) { + closeCueFile(); + } + } + updateFromPreferences(); // Update file location from preferences. + if (openFile()) { + qDebug() << "Splitting to a new file: "<< m_fileName; + m_pRecReady->set(RECORD_ON); + emit(isRecording(true, false)); // will notify the RecordingManager + + // Since we just started recording, timeout and clear the metadata. + m_iMetaDataLife = kMetaDataLifeTimeout; + m_pCurrentTrack = TrackPointer(); + + // clean frames counting and get current sample rate. + m_frames = 0; + m_sampleRate = m_pSamplerate->get(); + m_recordedDuration = 0; + + if (m_bCueIsEnabled) { + openCueFile(); + m_cueTrack = 0; + } + } else { // Maybe the encoder could not be initialized + qDebug() << "Could not open" << m_fileName << "for writing."; + Event::end("EngineRecord recording"); + qDebug("Setting record flag to: OFF"); + m_pRecReady->slotSet(RECORD_OFF); + // An error occurred. + emit(isRecording(false, true)); + } + } + + if (recordingStatus == RECORD_ON || recordingStatus == RECORD_SPLIT_CONTINUE) { // If recording is enabled process audio to compressed or uncompressed data. if (m_encoding == ENCODING_WAVE || m_encoding == ENCODING_AIFF) { if (m_pSndfile != NULL) { @@ -205,6 +254,16 @@ void EngineRecord::process(const CSAMPLE* pBuffer, const int iBufferSize) { m_pEncoder->encodeBuffer(pBuffer, iBufferSize); } } + + //Writing cueLine before updating the time counter since we preffer to be ahead + //rather than late. + if (m_bCueIsEnabled) { + if (metaDataHasChanged()) { + m_cueTrack++; + writeCueLine(); + m_cueFile.flush(); + } + } // update frames counting and recorded duration (seconds) m_frames += iBufferSize / 2; @@ -214,15 +273,7 @@ void EngineRecord::process(const CSAMPLE* pBuffer, const int iBufferSize) { // gets recorded duration and emit signal that will be used // by RecordingManager to update the label besides start/stop button if (lastDuration != m_recordedDuration) { - emit(durationRecorded(getRecordedDurationStr())); - } - - if (m_bCueIsEnabled) { - if (metaDataHasChanged()) { - m_cueTrack++; - writeCueLine(); - m_cueFile.flush(); - } + emit(durationRecorded(m_recordedDuration)); } } } @@ -308,6 +359,10 @@ bool EngineRecord::openFile() { #endif if (m_pSndfile) { sf_command(m_pSndfile, SFC_SET_NORM_FLOAT, NULL, SF_TRUE); + // Warning! Depending on how libsndfile is compiled autoclip may not work. + // Ensure CPU_CLIPS_NEGATIVE and CPU_CLIPS_POSITIVE is setup properly in the build. + sf_command(m_pSndfile, SFC_SET_CLIPPING, NULL, SF_TRUE) ; + // Set meta data int ret = sf_set_string(m_pSndfile, SF_STR_TITLE, m_baTitle.constData()); if (ret != 0) { @@ -370,7 +425,8 @@ bool EngineRecord::openCueFile() { } m_cueFile.write(QString("FILE \"%1\" %2%3\n").arg( - QString(m_fileName).replace(QString("\""), QString("\\\"")), + QFileInfo(m_fileName).fileName() //strip path + .replace(QString("\""), QString("\\\"")), // escape doublequote QString(m_encoding).toUpper(), m_encoding == ENCODING_WAVE ? "E" : " ").toLatin1()); return true; diff --git a/src/engine/sidechain/enginerecord.h b/src/engine/sidechain/enginerecord.h index b1a387a13372..1f6f1751a910 100644 --- a/src/engine/sidechain/enginerecord.h +++ b/src/engine/sidechain/enginerecord.h @@ -66,7 +66,7 @@ class EngineRecord : public QObject, public EncoderCallback, public SideChainWor // only one error can occur: the specified file was unable to be opened for // writing. void isRecording(bool recording, bool error); - void durationRecorded(QString duration); + void durationRecorded(quint64 durationInt); private: int getActiveTracks(); diff --git a/src/library/recording/dlgrecording.cpp b/src/library/recording/dlgrecording.cpp index 019a4c32b186..043a9fffd152 100644 --- a/src/library/recording/dlgrecording.cpp +++ b/src/library/recording/dlgrecording.cpp @@ -34,8 +34,8 @@ DlgRecording::DlgRecording(QWidget* parent, UserSettingsPointer pConfig, connect(m_pRecordingManager, SIGNAL(isRecording(bool)), this, SLOT(slotRecordingEnabled(bool))); - connect(m_pRecordingManager, SIGNAL(bytesRecorded(long)), - this, SLOT(slotBytesRecorded(long))); + connect(m_pRecordingManager, SIGNAL(bytesRecorded(int)), + this, SLOT(slotBytesRecorded(int))); connect(m_pRecordingManager, SIGNAL(durationRecorded(QString)), this, SLOT(slotDurationRecorded(QString))); @@ -129,7 +129,7 @@ void DlgRecording::slotRecordingEnabled(bool isRecording) { } // gets number of recorded bytes and update label -void DlgRecording::slotBytesRecorded(long bytes) { +void DlgRecording::slotBytesRecorded(int bytes) { double megabytes = bytes / 1048576.0; m_bytesRecordedStr = QString::number(megabytes,'f',2); refreshLabel(); diff --git a/src/library/recording/dlgrecording.h b/src/library/recording/dlgrecording.h index 0f8db1f42ade..53b515bf3223 100644 --- a/src/library/recording/dlgrecording.h +++ b/src/library/recording/dlgrecording.h @@ -36,7 +36,7 @@ class DlgRecording : public QWidget, public Ui::DlgRecording, public virtual Lib public slots: void toggleRecording(bool toggle); void slotRecordingEnabled(bool); - void slotBytesRecorded(long); + void slotBytesRecorded(int); void refreshBrowseModel(); void slotRestoreSearch(); void slotDurationRecorded(QString durationRecorded); diff --git a/src/preferences/dialog/dlgprefrecord.cpp b/src/preferences/dialog/dlgprefrecord.cpp index e45c3c1e85db..c2992bc923a9 100644 --- a/src/preferences/dialog/dlgprefrecord.cpp +++ b/src/preferences/dialog/dlgprefrecord.cpp @@ -37,8 +37,6 @@ DlgPrefRecord::DlgPrefRecord(QWidget* parent, UserSettingsPointer pConfig) setupUi(this); // See RECORD_* #defines in defs_recording.h - m_pRecordControl = new ControlProxy( - RECORDING_PREF_KEY, "status", this); m_pRadioOgg = new QRadioButton("Ogg Vorbis"); m_pRadioMp3 = new QRadioButton(ENCODING_MP3); @@ -116,22 +114,27 @@ DlgPrefRecord::DlgPrefRecord(QWidget* parent, UserSettingsPointer pConfig) this, SLOT(slotChangeSplitSize())); slotApply(); - // Make sure a corrupt config file won't cause us to record constantly. - m_pRecordControl->set(RECORD_OFF); comboBoxSplitting->addItem(SPLIT_650MB); comboBoxSplitting->addItem(SPLIT_700MB); comboBoxSplitting->addItem(SPLIT_1024MB); comboBoxSplitting->addItem(SPLIT_2048MB); comboBoxSplitting->addItem(SPLIT_4096MB); + comboBoxSplitting->addItem(SPLIT_60MIN); + comboBoxSplitting->addItem(SPLIT_74MIN); + comboBoxSplitting->addItem(SPLIT_80MIN); + comboBoxSplitting->addItem(SPLIT_120MIN); QString fileSizeStr = m_pConfig->getValueString(ConfigKey(RECORDING_PREF_KEY, "FileSize")); int index = comboBoxSplitting->findText(fileSizeStr); - if (index > 0) { + if (index >= 0) { // Set file split size comboBoxSplitting->setCurrentIndex(index); } - // Otherwise 650 MB will be default file split size. + else { + //Use max RIFF size (4GB) as default index, since usually people don't want to split. + comboBoxSplitting->setCurrentIndex(4); + } // Read CUEfile info CheckBoxRecordCueFile->setChecked( @@ -220,15 +223,15 @@ void DlgPrefRecord::slotRecordPathChange() { void DlgPrefRecord::slotResetToDefaults() { m_pRadioWav->setChecked(true); CheckBoxRecordCueFile->setChecked(false); - // 650MB splitting is the default - comboBoxSplitting->setCurrentIndex(0); + // 4GB splitting is the default + comboBoxSplitting->setCurrentIndex(4); LineEditTitle->setText(""); LineEditAlbum->setText(""); LineEditAuthor->setText(""); - // 6 corresponds to 128kbps (only used by MP3 and Ogg though) - SliderQuality->setValue(6); + // 1 corresponds to 16 bits (WAVE/AIFF) + SliderQuality->setValue(1); } // This function updates/refreshes the contents of this dialog. diff --git a/src/preferences/dialog/dlgprefrecord.h b/src/preferences/dialog/dlgprefrecord.h index 5adeb93fdef4..f7048343a956 100644 --- a/src/preferences/dialog/dlgprefrecord.h +++ b/src/preferences/dialog/dlgprefrecord.h @@ -61,7 +61,6 @@ class DlgPrefRecord : public DlgPreferencePage, public Ui::DlgPrefRecordDlg { // Pointer to config object UserSettingsPointer m_pConfig; - ControlProxy* m_pRecordControl; bool m_bConfirmOverwrite; QString fileTypeExtension; QRadioButton* m_pRadioOgg; diff --git a/src/recording/defs_recording.h b/src/recording/defs_recording.h index 4fbb6f52ac90..50600096cf89 100644 --- a/src/recording/defs_recording.h +++ b/src/recording/defs_recording.h @@ -11,6 +11,7 @@ #define RECORD_OFF 0.0 #define RECORD_READY 1.0 #define RECORD_ON 2.0 +#define RECORD_SPLIT_CONTINUE 3.0 //File options for preferences Splitting #define SPLIT_650MB "650 MB (CD)" @@ -18,14 +19,17 @@ #define SPLIT_1024MB "1 GB" #define SPLIT_2048MB "2 GB" #define SPLIT_4096MB "4 GB" +#define SPLIT_60MIN "60 Minutes" +#define SPLIT_74MIN "74 Minutes (CD)" +#define SPLIT_80MIN "80 Minutes (CD)" +#define SPLIT_120MIN "120 Minutes" -// Byte conversions Instead of multiplying megabytes with 1024 to get kilobytes -// I use 1000 Once the recording size has reached there's enough room to add +// Byte conversions. Slightly rounded to leave enough room to add // closing frames by the encoder. All sizes are in bytes. -#define SIZE_650MB Q_UINT64_C(650000000) -#define SIZE_700MB Q_UINT64_C(750000000) -#define SIZE_1GB Q_UINT64_C(1000000000) -#define SIZE_2GB Q_UINT64_C(2000000000) -#define SIZE_4GB Q_UINT64_C(4000000000) +#define SIZE_650MB Q_UINT64_C(680000000) +#define SIZE_700MB Q_UINT64_C(730000000) +#define SIZE_1GB Q_UINT64_C(1070000000) +#define SIZE_2GB Q_UINT64_C(2140000000) +#define SIZE_4GB Q_UINT64_C(4280000000) #endif diff --git a/src/recording/recordingmanager.cpp b/src/recording/recordingmanager.cpp index 33b758b59ad6..417cc2e6eed2 100644 --- a/src/recording/recordingmanager.cpp +++ b/src/recording/recordingmanager.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include "control/controlproxy.h" #include "control/controlpushbutton.h" @@ -21,9 +22,12 @@ RecordingManager::RecordingManager(UserSettingsPointer pConfig, EngineMaster* pE m_recordingLocation(""), m_bRecording(false), m_iNumberOfBytesRecorded(0), + m_iNumberOfBytesRecordedSplit(0), m_split_size(0), + m_split_time(0), m_iNumberSplits(0), - m_durationRecorded("") { + m_secondsRecorded(0), + m_secondsRecordedSplit(0) { m_pToggleRecording = new ControlPushButton(ConfigKey(RECORDING_PREF_KEY, "toggle_recording")); connect(m_pToggleRecording, SIGNAL(valueChanged(double)), this, SLOT(slotToggleRecording(double))); @@ -31,6 +35,7 @@ RecordingManager::RecordingManager(UserSettingsPointer pConfig, EngineMaster* pE m_recReady = new ControlProxy(m_recReadyCO->getKey(), this); m_split_size = getFileSplitSize(); + m_split_time = getFileSplitSeconds(); // Register EngineRecord with the engine sidechain. @@ -41,8 +46,8 @@ RecordingManager::RecordingManager(UserSettingsPointer pConfig, EngineMaster* pE this, SLOT(slotIsRecording(bool, bool))); connect(pEngineRecord, SIGNAL(bytesRecorded(int)), this, SLOT(slotBytesRecorded(int))); - connect(pEngineRecord, SIGNAL(durationRecorded(QString)), - this, SLOT(slotDurationRecorded(QString))); + connect(pEngineRecord, SIGNAL(durationRecorded(quint64)), + this, SLOT(slotDurationRecorded(quint64))); pSidechain->addSideChainWorker(pEngineRecord); } } @@ -79,40 +84,60 @@ void RecordingManager::slotToggleRecording(double v) { } } -void RecordingManager::startRecording(bool generateFileName) { - m_iNumberOfBytesRecorded = 0; - m_split_size = getFileSplitSize(); - qDebug() << "Split size is:" << m_split_size; +void RecordingManager::startRecording() { QString encodingType = m_pConfig->getValueString( ConfigKey(RECORDING_PREF_KEY, "Encoding")); - if(generateFileName) { - m_iNumberSplits = 1; - // Append file extension. - QString date_time_str = formatDateTimeForFilename(QDateTime::currentDateTime()); - m_recordingFile = QString("%1.%2") - .arg(date_time_str, encodingType.toLower()); - - // Storing the absolutePath of the recording file without file extension. - m_recording_base_file = getRecordingDir(); - m_recording_base_file.append("/").append(date_time_str); - // Appending file extension to get the filelocation. - m_recordingLocation = m_recording_base_file + "."+ encodingType.toLower(); - m_pConfig->set(ConfigKey(RECORDING_PREF_KEY, "Path"), m_recordingLocation); - m_pConfig->set(ConfigKey(RECORDING_PREF_KEY, "CuePath"), m_recording_base_file +".cue"); - } else { - // This is only executed if filesplit occurs. - ++m_iNumberSplits; - QString new_base_filename = m_recording_base_file +"part"+QString::number(m_iNumberSplits); - m_recordingLocation = new_base_filename + "." +encodingType.toLower(); - - m_pConfig->set(ConfigKey(RECORDING_PREF_KEY, "Path"), m_recordingLocation); - m_pConfig->set(ConfigKey(RECORDING_PREF_KEY, "CuePath"), new_base_filename +".cue"); - m_recordingFile = QFileInfo(m_recordingLocation).fileName(); + m_iNumberOfBytesRecordedSplit = 0; + m_secondsRecordedSplit=0; + m_iNumberOfBytesRecorded = 0; + m_secondsRecorded=0; + m_split_size = getFileSplitSize(); + m_split_time = getFileSplitSeconds(); + if (m_split_time < INT_MAX) { + qDebug() << "Split time is:" << m_split_time; + } + else { + qDebug() << "Split size is:" << m_split_size; } + + m_iNumberSplits = 1; + // Append file extension. + QString date_time_str = formatDateTimeForFilename(QDateTime::currentDateTime()); + m_recordingFile = QString("%1.%2") + .arg(date_time_str, encodingType.toLower()); + + // Storing the absolutePath of the recording file without file extension. + m_recording_base_file = getRecordingDir(); + m_recording_base_file.append("/").append(date_time_str); + // Appending file extension to get the filelocation. + m_recordingLocation = m_recording_base_file + "."+ encodingType.toLower(); + m_pConfig->set(ConfigKey(RECORDING_PREF_KEY, "Path"), m_recordingLocation); + m_pConfig->set(ConfigKey(RECORDING_PREF_KEY, "CuePath"), m_recording_base_file +".cue"); + m_recReady->set(RECORD_READY); } +void RecordingManager::splitContinueRecording() +{ + ++m_iNumberSplits; + m_secondsRecorded+=m_secondsRecordedSplit; + + m_iNumberOfBytesRecordedSplit = 0; + m_secondsRecordedSplit=0; + + QString encodingType = m_pConfig->getValueString(ConfigKey(RECORDING_PREF_KEY, "Encoding")); + + QString new_base_filename = m_recording_base_file +"part"+QString::number(m_iNumberSplits); + m_recordingLocation = new_base_filename + "." +encodingType.toLower(); + + m_pConfig->set(ConfigKey(RECORDING_PREF_KEY, "Path"), m_recordingLocation); + m_pConfig->set(ConfigKey(RECORDING_PREF_KEY, "CuePath"), new_base_filename +".cue"); + m_recordingFile = QFileInfo(m_recordingLocation).fileName(); + + m_recReady->set(RECORD_SPLIT_CONTINUE); +} + void RecordingManager::stopRecording() { qDebug() << "Recording stopped"; @@ -120,8 +145,10 @@ void RecordingManager::stopRecording() m_recordingFile = ""; m_recordingLocation = ""; m_iNumberOfBytesRecorded = 0; + m_secondsRecorded = 0; } + void RecordingManager::setRecordingDir() { QDir recordDir(m_pConfig->getValueString( ConfigKey(RECORDING_PREF_KEY, "Directory"))); @@ -145,26 +172,42 @@ QString& RecordingManager::getRecordingDir() { } // Only called when recording is active. -void RecordingManager::slotDurationRecorded(QString durationStr) +void RecordingManager::slotDurationRecorded(quint64 duration) { - if(m_durationRecorded != durationStr) + if(m_secondsRecordedSplit != duration) { - m_durationRecorded = durationStr; - emit(durationRecorded(m_durationRecorded)); + m_secondsRecordedSplit = duration; + if(duration >= m_split_time) + { + qDebug() << "Splitting after " << duration << " seconds"; + // This will reuse the previous filename but append a suffix. + splitContinueRecording(); + } + emit(durationRecorded(getRecordedDurationStr(m_secondsRecorded+m_secondsRecordedSplit))); } } +// Copy from the implementation in enginerecord.cpp +QString RecordingManager::getRecordedDurationStr(unsigned int duration) { + return QString("%1:%2") + .arg(duration / 60, 2, 'f', 0, '0') // minutes + .arg(duration % 60, 2, 'f', 0, '0'); // seconds +} // Only called when recording is active. void RecordingManager::slotBytesRecorded(int bytes) { - // auto conversion to long + // auto conversion to quint64 m_iNumberOfBytesRecorded += bytes; - if(m_iNumberOfBytesRecorded >= m_split_size) + m_iNumberOfBytesRecordedSplit += bytes; + + //Split before reaching the max size. m_split_size has some headroom, as + //seen in the constant defintions in defs_recording.h. Also, note that + //bytes are increased in the order of 10s of KBs each call. + if(m_iNumberOfBytesRecordedSplit >= m_split_size) { - stopRecording(); - // Dont generate a new filename. + qDebug() << "Splitting after " << m_iNumberOfBytesRecorded << " bytes written"; // This will reuse the previous filename but append a suffix. - startRecording(false); + splitContinueRecording(); } emit(bytesRecorded(m_iNumberOfBytesRecorded)); } @@ -200,7 +243,7 @@ QString& RecordingManager::getRecordingLocation() { return m_recordingLocation; } -long RecordingManager::getFileSplitSize() +quint64 RecordingManager::getFileSplitSize() { QString fileSizeStr = m_pConfig->getValueString(ConfigKey(RECORDING_PREF_KEY, "FileSize")); if(fileSizeStr == SPLIT_650MB) @@ -213,6 +256,28 @@ long RecordingManager::getFileSplitSize() return SIZE_2GB; else if(fileSizeStr == SPLIT_4096MB) return SIZE_4GB; + else if(fileSizeStr == SPLIT_60MIN) + return SIZE_4GB; //Ignore size limit. use time limit + else if(fileSizeStr == SPLIT_74MIN) + return SIZE_4GB; //Ignore size limit. use time limit + else if(fileSizeStr == SPLIT_80MIN) + return SIZE_4GB; //Ignore size limit. use time limit + else if(fileSizeStr == SPLIT_120MIN) + return SIZE_4GB; //Ignore size limit. use time limit else return SIZE_650MB; } +unsigned int RecordingManager::getFileSplitSeconds() +{ + QString fileSizeStr = m_pConfig->getValueString(ConfigKey(RECORDING_PREF_KEY, "FileSize")); + if(fileSizeStr == SPLIT_60MIN) + return 60*60; + else if(fileSizeStr == SPLIT_74MIN) + return 74*60; + else if(fileSizeStr == SPLIT_80MIN) + return 80*60; + else if(fileSizeStr == SPLIT_120MIN) + return 120*60; + else // Do not limit by time for the rest. + return INT_MAX; +} diff --git a/src/recording/recordingmanager.h b/src/recording/recordingmanager.h index 6a2f48b224e1..ac7d3ed1f795 100644 --- a/src/recording/recordingmanager.h +++ b/src/recording/recordingmanager.h @@ -34,12 +34,8 @@ class RecordingManager : public QObject // This will try to start recording. If successful, slotIsRecording will be // called and a signal isRecording will be emitted. - // Parameter semantic: If true, the method computes the filename based on - // date/time information. This is the default behavior. If false, - // slotBytesRecorded just noticed that recording must be interrupted - // to split the file. The nth filename will follow the date/time - // name of the first split but with a suffix. - void startRecording(bool generateFileName=true); + // The method computes the filename based on date/time information. + void startRecording(); void stopRecording(); bool isRecordingActive(); void setRecordingDir(); @@ -50,14 +46,14 @@ class RecordingManager : public QObject signals: // Emits the cumulative number of bytes currently recorded. - void bytesRecorded(long); + void bytesRecorded(int); void isRecording(bool); void durationRecorded(QString); public slots: void slotIsRecording(bool recording, bool error); void slotBytesRecorded(int); - void slotDurationRecorded(QString); + void slotDurationRecorded(quint64); private slots: void slotSetRecording(bool recording); @@ -65,11 +61,16 @@ class RecordingManager : public QObject private: QString formatDateTimeForFilename(QDateTime dateTime) const; + // slotBytesRecorded just noticed that recording must be interrupted + // to split the file. The nth filename will follow the date/time + // name of the first split but with a suffix. + void splitContinueRecording(); ControlProxy* m_recReady; ControlObject* m_recReadyCO; ControlPushButton* m_pToggleRecording; - long getFileSplitSize(); + quint64 getFileSplitSize(); + unsigned int getFileSplitSeconds(); UserSettingsPointer m_pConfig; QString m_recordingDir; @@ -83,9 +84,13 @@ class RecordingManager : public QObject bool m_bRecording; // will be a very large number quint64 m_iNumberOfBytesRecorded; + quint64 m_iNumberOfBytesRecordedSplit; quint64 m_split_size; + unsigned int m_split_time; int m_iNumberSplits; - QString m_durationRecorded; + unsigned int m_secondsRecorded; + unsigned int m_secondsRecordedSplit; + QString getRecordedDurationStr(unsigned int duration); }; #endif // RECORDINGMANAGER_H