mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Ref T494, added new sounds
This commit is contained in:
committed by
Mat Sutcliffe
parent
80ed972e53
commit
dc8ea83839
BIN
src/blacksound/share/sounds/callsignmentioned.wav
Normal file
BIN
src/blacksound/share/sounds/callsignmentioned.wav
Normal file
Binary file not shown.
BIN
src/blacksound/share/sounds/pttclick.wav
Normal file
BIN
src/blacksound/share/sounds/pttclick.wav
Normal file
Binary file not shown.
@@ -486,7 +486,7 @@ namespace BlackSound
|
||||
CSoundGenerator::playSelcal(volume, selcal, CSoundGenerator::findClosestOutputDevice(audioDevice));
|
||||
}
|
||||
|
||||
void CSoundGenerator::playNotificationSound(int volume, CNotificationSounds::Notification notification)
|
||||
void CSoundGenerator::playNotificationSound(int volume, CNotificationSounds::NotificationFlag notification)
|
||||
{
|
||||
QMediaPlayer *mediaPlayer = CSoundGenerator::mediaPlayer();
|
||||
if (mediaPlayer->state() == QMediaPlayer::PlayingState) return;
|
||||
@@ -500,15 +500,19 @@ namespace BlackSound
|
||||
success = playlist->addMedia(QUrl::fromLocalFile(CDirectoryUtils::soundFilesDirectory() + "/login.wav")) && success;
|
||||
success = playlist->addMedia(QUrl::fromLocalFile(CDirectoryUtils::soundFilesDirectory() + "/logoff.wav")) && success;
|
||||
success = playlist->addMedia(QUrl::fromLocalFile(CDirectoryUtils::soundFilesDirectory() + "/privatemessage.wav")) && success;
|
||||
success = playlist->addMedia(QUrl::fromLocalFile(CDirectoryUtils::soundFilesDirectory() + "/callsignmentioned.wav")) && success;
|
||||
success = playlist->addMedia(QUrl::fromLocalFile(CDirectoryUtils::soundFilesDirectory() + "/voiceroomjoined.wav")) && success;
|
||||
success = playlist->addMedia(QUrl::fromLocalFile(CDirectoryUtils::soundFilesDirectory() + "/voiceroomleft.wav")) && success;
|
||||
success = playlist->addMedia(QUrl::fromLocalFile(CDirectoryUtils::soundFilesDirectory() + "/pttclick.wav")) && success;
|
||||
|
||||
Q_ASSERT(success);
|
||||
playlist->setPlaybackMode(QMediaPlaylist::CurrentItemOnce);
|
||||
mediaPlayer->setPlaylist(playlist);
|
||||
}
|
||||
if (notification == CNotificationSounds::NotificationsLoadSounds) return;
|
||||
int index = static_cast<int>(notification);
|
||||
if (notification == CNotificationSounds::LoadSounds) { return; }
|
||||
if (notification == CNotificationSounds::NoNotifications) { return; }
|
||||
|
||||
const int index = qRound(std::log2(static_cast<double>(notification)));
|
||||
playlist->setCurrentIndex(index);
|
||||
mediaPlayer->setVolume(volume); // 0-100
|
||||
mediaPlayer->play();
|
||||
|
||||
@@ -169,7 +169,7 @@ namespace BlackSound
|
||||
//! Play notification
|
||||
//! \param volume 0-100
|
||||
//! \param notification
|
||||
static void playNotificationSound(int volume, BlackMisc::Audio::CNotificationSounds::Notification notification);
|
||||
static void playNotificationSound(int volume, BlackMisc::Audio::CNotificationSounds::NotificationFlag notification);
|
||||
|
||||
//! For debugging purposes
|
||||
static void printAllQtSoundDevices(QTextStream &qtout);
|
||||
|
||||
Reference in New Issue
Block a user