Skip to content

Commit

Permalink
Updated VenturousCore with fixed parsing Audacious stderr; set applic…
Browse files Browse the repository at this point in the history
…ation version to 1.1.1.
  • Loading branch information
vedgy committed May 27, 2014
1 parent 76df3d7 commit 351377e
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ command line interface.
Currently only Audacious media player is supported, but adding support for
other players should be quite simple.

Venturous is built around one feature, which is missing in most (maybe
Venturous is built around one feature, which is missing from most (maybe
even all) media players: user-defined items for random playback. This
feature is especially useful for grouping separate tracks that are
actually parts of one composition. For example parts of classical music
Expand Down Expand Up @@ -46,7 +46,7 @@ GNU/Linux or MS Windows (might also work in OS X, not tested).

3. If you want to install latest stable version, execute the following command:

git checkout tags/v1.1
git checkout tags/v1.1.1
If you prefer latest development version (can be unstable), just skip this step.

4. Run configuration script:
Expand Down
2 changes: 1 addition & 1 deletion modules/VenturousCore
4 changes: 2 additions & 2 deletions resources/documents/user-guide.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</head>

<body>
<h1><i>Venturous</i> - version 1.1</h1>
<h1><i>Venturous</i> - version 1.1.1</h1>

<a id="Index"><h2>Table of contents</h2></a>
<ul>
Expand All @@ -31,7 +31,7 @@ <h1><i>Venturous</i> - version 1.1</h1>
<p><i>Venturous</i> is a random playback manager, which uses media player's
command line interface. Currently only <i>Audacious</i> media player is
supported, but adding support for other players should be quite simple.</p>
<p><i>Venturous</i> is built around one feature, which is missing in most
<p><i>Venturous</i> is built around one feature, which is missing from most
(maybe even all) media players: user-defined items for random playback. This
feature is especially useful for grouping separate tracks that are
actually parts of one composition. For example, parts of classical music
Expand Down
2 changes: 1 addition & 1 deletion src/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

Application::Application(int & argc, char ** argv) : QApplication(argc, argv)
{
setApplicationVersion("1.1");
setApplicationVersion("1.1.1");
setAttribute(Qt::AA_DontShowIconsInMenus, false);
setQuitOnLastWindowClosed(false);
}
Expand Down
21 changes: 17 additions & 4 deletions src/GUI/MainWindow/PlaybackComponent/PlaybackComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,9 @@ void PlaybackComponent::onPlayerFinished(
const bool crashExit, const int exitCode,
std::vector<std::string> missingFilesAndDirs)
{
bool normalExit = true;
if (crashExit || exitCode != 0) {
normalExit = false;
QString message =
tr("%1 %2 with exit code %3.")
.arg(QtUtilities::toQString(MediaPlayer::playerName()),
Expand All @@ -207,6 +209,7 @@ void PlaybackComponent::onPlayerFinished(
}

if (! missingFilesAndDirs.empty()) {
normalExit = false;
QString message = tr("No such files or directories (%1):")
.arg(missingFilesAndDirs.size());
for (const std::string & s : missingFilesAndDirs)
Expand All @@ -219,6 +222,13 @@ void PlaybackComponent::onPlayerFinished(
}
}

if (normalExit && ! isPlayerRunning_) {
if (! criticalContinuePlaybackQuestion(
tr("Error has occured"), QString())) {
return;
}
}

actions_.next->trigger();
}

Expand All @@ -231,13 +241,16 @@ void PlaybackComponent::onPlayerError(std::string errorMessage)
}

bool PlaybackComponent::criticalContinuePlaybackQuestion(
const QString & title, const QString & errorMessage)
const QString & title, QString errorMessage)
{
if (! errorMessage.isEmpty())
errorMessage += "\n\t";
errorMessage += tr("Continue playback?");
setPlayerState(false);
const auto selectedButton =
inputController_.showMessage(
title, errorMessage + tr("\n\tContinue playback?"),
QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
inputController_.showMessage(title, errorMessage,
QMessageBox::Yes | QMessageBox::No,
QMessageBox::No);
return selectedButton == QMessageBox::Yes;
}

Expand Down
4 changes: 2 additions & 2 deletions src/GUI/MainWindow/PlaybackComponent/PlaybackComponent.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ class PlaybackComponent : public QObject
/// @param title Title of the message box.
/// @param errorMessage Message to be displayed before question.
/// @return true if playback should be continued.
bool criticalContinuePlaybackQuestion(
const QString & title, const QString & errorMessage);
bool criticalContinuePlaybackQuestion(const QString & title,
QString errorMessage);

/// @brief Starts playing entry. Does not call historyWidget_.push().
/// NOTE: does not block execution.
Expand Down

0 comments on commit 351377e

Please sign in to comment.