Skip to content
This repository has been archived by the owner on Aug 26, 2020. It is now read-only.

Commit

Permalink
v0.8.9 - Windows fixes for sound and first two menus.
Browse files Browse the repository at this point in the history
  • Loading branch information
3vi1 committed May 29, 2017
1 parent 6d928bb commit d7c30eb
Show file tree
Hide file tree
Showing 9 changed files with 89 additions and 103 deletions.
10 changes: 8 additions & 2 deletions docs/RELEASES
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
0.8.9 - Fixes the bug where the first two menu dropdowns were no longer
working for Windows users.

Sound fixes and optimization.

0.8.8 - Fixes crashes when changing regions due to access of invalidated
logInfo pointers.

Expand Down Expand Up @@ -254,8 +259,9 @@

Coming soon:

- Checkbox to only read local logs on startup.
- Ignore system when worded like "from kbp", "was n-r"
- fix display of messages with backslashes.
- add support for hyperlinks in message list.
- additional sound/volume options for alerts, dependant on jump distance.
- better memory cache/cleanup.
- investigate crash on region change.
- better pilot cache/cleanup.
51 changes: 45 additions & 6 deletions src/audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,66 @@
//#include <QAudio>
#include <QCoreApplication>
#include <QDebug>
#include <QDir>
#include <QFileInfo>
#include <QStandardPaths>

ImpAudio::ImpAudio(QObject *parent) : QObject(parent)
{
cacheSounds();
}

QSoundEffect* ImpAudio::playLocalFile(const QString& fileName)
void ImpAudio::cacheSounds()
{
QString path = appFilesPath() + "/audio/";

QDir audioDir(path);
audioDir.setFilter(QDir::Files);

// Load up style combo
foreach(QFileInfo fileInfo, audioDir.entryInfoList())
{
if(fileInfo.fileName().endsWith(".dll"))
continue;

QSoundEffect* effect = new QSoundEffect(this);
effect->setSource(QUrl::fromLocalFile(fileInfo.absoluteFilePath()));

if(!effects.contains(fileInfo.fileName()))
effects.insert(fileInfo.fileName(), effect);
}
}

void ImpAudio::playLocalFile(const QString& fileName)
{
if(!effects.contains(fileName))
{
QString path = appFilesPath() + "/audio/" + fileName;
QSoundEffect* effect = new QSoundEffect(this);
effect->setSource(QUrl::fromLocalFile(path));
effects.insert(fileName, effect);
}

effects[fileName]->setVolume(volume);
effects[fileName]->play();
}

QSoundEffect* ImpAudio::oldPlayLocalFile(const QString& fileName)
{
QString path = appFilesPath() + "/audio/" + fileName;

qDebug() << "Playing " << path;
qDebug() << "ImpAudio::playLocalFile - Playing " << path;


QSoundEffect* effect = new QSoundEffect(this);
effect->setSource(QUrl::fromLocalFile(path));

qDebug() << "Setting volume on effect to " << QString::number(volume, 'g', 2);
qDebug() << "ImpAudio::playLocalFile - Setting volume on effect to " << QString::number(volume, 'g', 2);
effect->setVolume(volume);
connect(effect, &QSoundEffect::playingChanged, this, &ImpAudio::playingChanged);
effect->play();

connect(effect, SIGNAL(playingChanged()), this, SLOT(playingChanged()));

qDebug() << "ImpAudio::playLocalFile - played " << &effect;
return effect;
}

Expand All @@ -54,7 +92,8 @@ void ImpAudio::playingChanged()
QSoundEffect *s = qobject_cast<QSoundEffect *> (sender());
if (!s->isPlaying())
{
s->deleteLater();
qDebug() << "ImpAudio::playingChanged - cleaning up " << &s;
s->deleteLater();
}
}

Expand Down
6 changes: 5 additions & 1 deletion src/audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,16 @@ class ImpAudio : public QObject
public:
explicit ImpAudio(QObject *parent = 0);

QSoundEffect* playLocalFile(const QString& fileName);
void playLocalFile(const QString& fileName);
QSoundEffect* oldPlayLocalFile(const QString& fileName);

void playLocalMedia(const QString& fileName);
void stopMusic();

void setVolume(int i);

void cacheSounds();

signals:

public slots:
Expand All @@ -48,6 +51,7 @@ public slots:
qreal volume = 1.0f;

QMediaPlayer* player;
QMap<QString, QSoundEffect*> effects;
};

#endif // AUDIO_H
2 changes: 1 addition & 1 deletion src/imp.pro
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = imp
TEMPLATE = app

VERSION = 0.8.8
VERSION = 0.8.9
QMAKE_TARGET_COMPANY = EternalDusk
QMAKE_TARGET_DESCRIPTION = Eve Online Intelligence Management Program
QMAKE_TARGET_COPYRIGHT = (c) Copyright 2016-2017 Jesse Litton
Expand Down
4 changes: 2 additions & 2 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1449,7 +1449,7 @@ void MainWindow::switchToRegion(const QString& currentRegion)
void MainWindow::updateRegionMenu(const QString& currentRegion)
{
// Set menu checks
foreach(QAction* action, ui->menuRegion->actions())
foreach(QAction* action, ui->menuMap->actions())
{
if(action->text() == "&" + currentRegion)
{
Expand Down Expand Up @@ -1482,7 +1482,7 @@ void MainWindow::on_actionQuerious_triggered()
switchToRegion("Querious");
}

void MainWindow::on_actionSystem_triggered()
void MainWindow::on_actionFindSystem_triggered()
{
find.setList(regionMap->getSystemNames());
find.show();
Expand Down
2 changes: 1 addition & 1 deletion src/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ private slots:
void on_actionProvidence_triggered();
void on_actionCatch_triggered();
void on_actionQuerious_triggered();
void on_actionSystem_triggered();
void on_actionFindSystem_triggered();
void on_actionShow_Bridges_triggered(bool checked);
void on_actionSave_As_Theme_triggered();
void on_actionFindMessages_triggered();
Expand Down
112 changes: 24 additions & 88 deletions src/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
</widget>
<addaction name="menuSet_Location"/>
</widget>
<widget class="QMenu" name="menuRegion">
<widget class="QMenu" name="menuMap">
<property name="title">
<string>&amp;Map</string>
</property>
Expand All @@ -143,7 +143,7 @@
<string>&amp;Find</string>
</property>
<addaction name="actionFindMessages"/>
<addaction name="actionSystem"/>
<addaction name="actionFindSystem"/>
</widget>
<widget class="QMenu" name="menuTheme">
<property name="title">
Expand All @@ -167,14 +167,14 @@
<addaction name="action_Menu_Toggle"/>
<addaction name="action_Overlay_Mode"/>
</widget>
<addaction name="menuDebug"/>
<addaction name="menuPilots"/>
<addaction name="menuFind"/>
<addaction name="menuRegion"/>
<addaction name="menuMap"/>
<addaction name="menuOptions"/>
<addaction name="menuTheme"/>
<addaction name="menu_Window"/>
<addaction name="menuHelp"/>
<addaction name="menuDebug"/>
</widget>
<widget class="QStatusBar" name="statusBar">
<property name="autoFillBackground">
Expand Down Expand Up @@ -273,11 +273,17 @@
<property name="text">
<string>&amp;About</string>
</property>
<property name="toolTip">
<string>About IMP...</string>
</property>
</action>
<action name="actionOptions">
<property name="text">
<string>&amp;Options</string>
</property>
<property name="toolTip">
<string>Change IMP options and configuration.</string>
</property>
</action>
<action name="actionAuto_follow">
<property name="checkable">
Expand All @@ -289,10 +295,8 @@
<property name="text">
<string>Auto-follow</string>
</property>
</action>
<action name="actionSet_Location_F_Y">
<property name="text">
<string>Set Location: F-YH5B</string>
<property name="toolTip">
<string>Recenter map when changing systems.</string>
</property>
</action>
<action name="actionF_YH5B">
Expand All @@ -315,6 +319,9 @@
<property name="text">
<string>&amp;Providence</string>
</property>
<property name="toolTip">
<string>Show Providence region.</string>
</property>
</action>
<action name="actionCatch">
<property name="checkable">
Expand All @@ -323,6 +330,9 @@
<property name="text">
<string>&amp;Catch</string>
</property>
<property name="toolTip">
<string>Show Catch region.</string>
</property>
</action>
<action name="actionQuerious">
<property name="checkable">
Expand All @@ -331,8 +341,11 @@
<property name="text">
<string>&amp;Querious</string>
</property>
<property name="toolTip">
<string>Show Querious region.</string>
</property>
</action>
<action name="actionSystem">
<action name="actionFindSystem">
<property name="text">
<string>&amp;System (Ctrl+F)</string>
</property>
Expand All @@ -348,96 +361,19 @@
<string>Show &amp;Bridges</string>
</property>
</action>
<action name="action_Background">
<property name="text">
<string>&amp;Color</string>
</property>
</action>
<action name="actionLineColor">
<property name="text">
<string>Color</string>
</property>
</action>
<action name="actionSave_As_Theme">
<property name="text">
<string>Save &amp;As Theme</string>
</property>
</action>
<action name="actionPilotGraphic">
<property name="text">
<string>Indicator</string>
</property>
</action>
<action name="actionFindGraphic">
<property name="text">
<string>Indicator</string>
</property>
</action>
<action name="actionFindScale">
<property name="text">
<string>Scale</string>
</property>
</action>
<action name="actionFindOpacity">
<property name="text">
<string>Opacity</string>
</property>
</action>
<action name="actionPilotOpacity">
<property name="text">
<string>Opacity</string>
</property>
</action>
<action name="actionPilotScale">
<property name="text">
<string>Scale</string>
</property>
</action>
<action name="actionLineOpacity">
<property name="text">
<string>Opacity</string>
</property>
</action>
<action name="actionLineWidth">
<property name="text">
<string>Width</string>
</property>
</action>
<action name="actionFindX_Y_Offsets">
<property name="text">
<string>X/Y/Z Offsets</string>
</property>
</action>
<action name="actionPilotX_Y_Offsets">
<property name="text">
<string>X/Y/Z Offsets</string>
</property>
</action>
<action name="actionFontSystemName">
<property name="text">
<string>System Name</string>
</property>
</action>
<action name="actionFontTimer">
<property name="text">
<string>Timer</string>
<property name="toolTip">
<string>Save current theme customizations.</string>
</property>
</action>
<action name="actionFindMessages">
<property name="text">
<string>Messages</string>
</property>
</action>
<action name="actionBackgroundColor">
<property name="text">
<string>Color</string>
</property>
</action>
<action name="actionBackgroundImage">
<property name="text">
<string>Image</string>
</property>
</action>
<action name="actionCustomize">
<property name="text">
<string>&amp;Customize</string>
Expand Down
4 changes: 2 additions & 2 deletions src/meta.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ static const struct Version
{
Version(){}

QString release = "0.8.8"; //VERSION;
QString name = "Lycrash vs. Silver Pointers";
QString release = "0.8.9"; //VERSION;
QString name = "Unsound Lycaan";

QString styleHeader1 = "<span style=\" color:#0000ff;\">";
QString styleFooter1 = "</span>";
Expand Down
1 change: 1 addition & 0 deletions src/msgstyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

MsgStyle::MsgStyle(QWidget *parent) : QWidget(parent)
{
resize(0,0);
reset();
}

Expand Down

0 comments on commit d7c30eb

Please sign in to comment.