mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-18 03:48:09 +00:00
Clean Empty lines
This commit is contained in:
parent
65906d785c
commit
ea5c0787fe
3 changed files with 5 additions and 29 deletions
|
|
@ -247,16 +247,13 @@ void CoreManager::createLinphoneCore (const QString &configPath) {
|
|||
|
||||
// Migration of configuration and database files from GTK version of Linphone.
|
||||
Paths::migrate();
|
||||
|
||||
setResourcesPaths();
|
||||
|
||||
mCore = linphone::Factory::get()->createCore(
|
||||
Paths::getConfigFilePath(configPath),
|
||||
Paths::getFactoryConfigFilePath(),
|
||||
nullptr
|
||||
);
|
||||
mCore->addListener(mHandlers);
|
||||
|
||||
mCore->setVideoDisplayFilter("MSOGL");
|
||||
mCore->usePreviewWindow(true);
|
||||
mCore->setUserAgent(
|
||||
|
|
@ -268,7 +265,6 @@ void CoreManager::createLinphoneCore (const QString &configPath) {
|
|||
),
|
||||
mCore->getVersion()
|
||||
);
|
||||
|
||||
// Force capture/display.
|
||||
// Useful if the app was built without video support.
|
||||
// (The capture/display attributes are reset by the core in this case.)
|
||||
|
|
@ -277,12 +273,9 @@ void CoreManager::createLinphoneCore (const QString &configPath) {
|
|||
config->setInt("video", "capture", 1);
|
||||
config->setInt("video", "display", 1);
|
||||
}
|
||||
|
||||
mCore->start();
|
||||
|
||||
setDatabasesPaths();
|
||||
setOtherPaths();
|
||||
|
||||
mCore->enableFriendListSubscription(true);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ public:
|
|||
private:
|
||||
void onEofReached (const shared_ptr<linphone::Player> &) override {
|
||||
QMutex &mutex = mSoundPlayer->mForceCloseMutex;
|
||||
|
||||
// Workaround.
|
||||
// This callback is called in a standard thread of mediastreamer, not a QThread.
|
||||
// Signals, connect functions, timers... are unavailable.
|
||||
|
|
@ -51,7 +50,6 @@ private:
|
|||
mSoundPlayer->mForceClose = true;
|
||||
mutex.unlock();
|
||||
}
|
||||
|
||||
SoundPlayer *mSoundPlayer;
|
||||
};
|
||||
|
||||
|
|
@ -59,14 +57,12 @@ private:
|
|||
|
||||
SoundPlayer::SoundPlayer (QObject *parent) : QObject(parent) {
|
||||
CoreManager *coreManager = CoreManager::getInstance();
|
||||
SettingsModel *settingsModel = coreManager->getSettingsModel();
|
||||
SettingsModel *settingsModel = coreManager->getSettingsModel();
|
||||
mForceCloseTimer = new QTimer(this);
|
||||
|
||||
mForceCloseTimer->setInterval(ForceCloseTimerInterval);
|
||||
|
||||
QObject::connect(mForceCloseTimer, &QTimer::timeout, this, &SoundPlayer::handleEof);
|
||||
|
||||
mHandlers = make_shared<SoundPlayer::Handlers>(this);
|
||||
|
||||
QObject::connect(settingsModel, &SettingsModel::ringerDeviceChanged, this, [this] {
|
||||
rebuildInternalPlayer();
|
||||
});
|
||||
|
|
@ -83,15 +79,13 @@ SoundPlayer::~SoundPlayer () {
|
|||
void SoundPlayer::pause () {
|
||||
if (mPlaybackState == SoundPlayer::PausedState)
|
||||
return;
|
||||
|
||||
if (mInternalPlayer->pause()) {
|
||||
setError(QStringLiteral("Unable to pause: `%1`").arg(mSource));
|
||||
return;
|
||||
}
|
||||
|
||||
mForceCloseTimer->stop();
|
||||
mPlaybackState = SoundPlayer::PausedState;
|
||||
|
||||
|
||||
emit paused();
|
||||
emit playbackStateChanged(mPlaybackState);
|
||||
}
|
||||
|
|
@ -99,7 +93,6 @@ void SoundPlayer::pause () {
|
|||
void SoundPlayer::play () {
|
||||
if (mPlaybackState == SoundPlayer::PlayingState)
|
||||
return;
|
||||
|
||||
if (
|
||||
(mPlaybackState == SoundPlayer::StoppedState || mPlaybackState == SoundPlayer::ErrorState) &&
|
||||
mInternalPlayer->open(Utils::appStringToCoreString(mSource))
|
||||
|
|
@ -107,16 +100,14 @@ void SoundPlayer::play () {
|
|||
qWarning() << QStringLiteral("Unable to open: `%1`").arg(mSource);
|
||||
return;
|
||||
}
|
||||
|
||||
if (mInternalPlayer->start()
|
||||
) {
|
||||
setError(QStringLiteral("Unable to play: `%1`").arg(mSource));
|
||||
return;
|
||||
}
|
||||
|
||||
mForceCloseTimer->start();
|
||||
mPlaybackState = SoundPlayer::PlayingState;
|
||||
|
||||
|
||||
emit playing();
|
||||
emit playbackStateChanged(mPlaybackState);
|
||||
}
|
||||
|
|
@ -157,12 +148,10 @@ void SoundPlayer::rebuildInternalPlayer () {
|
|||
void SoundPlayer::stop (bool force) {
|
||||
if (mPlaybackState == SoundPlayer::StoppedState && !force)
|
||||
return;
|
||||
|
||||
mForceCloseTimer->stop();
|
||||
mPlaybackState = SoundPlayer::StoppedState;
|
||||
mInternalPlayer->close();
|
||||
|
||||
|
||||
|
||||
emit stopped();
|
||||
emit playbackStateChanged(mPlaybackState);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,11 +45,9 @@ SimpleCaptureGraph::~SimpleCaptureGraph()
|
|||
}
|
||||
|
||||
void SimpleCaptureGraph::init() {
|
||||
|
||||
if (!audioCapture) {
|
||||
audioCapture = ms_snd_card_create_reader(captureCard);
|
||||
}
|
||||
|
||||
if (!audioSink) {
|
||||
audioSink = ms_snd_card_create_writer(playbackCard);
|
||||
}
|
||||
|
|
@ -67,9 +65,7 @@ void SimpleCaptureGraph::init() {
|
|||
//Mute playback
|
||||
float muteGain = 0.0f;
|
||||
ms_filter_call_method(playbackVolumeFilter, static_cast<unsigned int>(MS_VOLUME_SET_GAIN), &muteGain);
|
||||
|
||||
ticker = ms_ticker_new();
|
||||
|
||||
running = false;
|
||||
}
|
||||
|
||||
|
|
@ -92,11 +88,9 @@ void SimpleCaptureGraph::destroy() {
|
|||
stop();
|
||||
}
|
||||
ms_ticker_destroy(ticker);
|
||||
|
||||
ms_filter_unlink(playbackVolumeFilter, 0, audioSink, 0);
|
||||
ms_filter_unlink(captureVolumeFilter, 0, playbackVolumeFilter, 0);
|
||||
ms_filter_unlink(audioCapture, 0, captureVolumeFilter, 0);
|
||||
|
||||
ms_filter_destroy(playbackVolumeFilter);
|
||||
ms_filter_destroy(captureVolumeFilter);
|
||||
ms_filter_destroy(audioSink);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue