Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
ffea268d
Commit
ffea268d
authored
Oct 17, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PlayerControl: GetError() returns an Error, not a char*
parent
8e676db6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
25 deletions
+26
-25
PlayerCommands.cxx
src/PlayerCommands.cxx
+3
-7
PlayerControl.cxx
src/PlayerControl.cxx
+0
-13
PlayerControl.hxx
src/PlayerControl.hxx
+23
-5
No files found.
src/PlayerCommands.cxx
View file @
ffea268d
...
...
@@ -32,8 +32,6 @@
#include "AudioFormat.hxx"
#include "ReplayGainConfig.hxx"
#include <glib.h>
#define COMMAND_STATUS_STATE "state"
#define COMMAND_STATUS_REPEAT "repeat"
#define COMMAND_STATUS_SINGLE "single"
...
...
@@ -190,13 +188,11 @@ handle_status(Client *client,
updateJobId
);
}
char
*
error
=
client
->
player_control
->
GetErrorMessage
();
if
(
error
!=
NULL
)
{
Error
error
=
client
->
player_control
->
LockGetError
();
if
(
error
.
IsDefined
())
client_printf
(
client
,
COMMAND_STATUS_ERROR
": %s
\n
"
,
error
);
g_free
(
error
);
}
error
.
GetMessage
());
song
=
playlist
.
GetNextPosition
();
if
(
song
>=
0
)
{
...
...
src/PlayerControl.cxx
View file @
ffea268d
...
...
@@ -23,8 +23,6 @@
#include "Song.hxx"
#include "DecoderControl.hxx"
#include <glib.h>
#include <cmath>
#include <assert.h>
...
...
@@ -202,17 +200,6 @@ player_control::ClearError()
Unlock
();
}
char
*
player_control
::
GetErrorMessage
()
const
{
Lock
();
char
*
message
=
error_type
!=
PlayerError
::
NONE
?
g_strdup
(
error
.
GetMessage
())
:
NULL
;
Unlock
();
return
message
;
}
void
player_control
::
EnqueueSong
(
Song
*
song
)
{
...
...
src/PlayerControl.hxx
View file @
ffea268d
...
...
@@ -325,14 +325,32 @@ public:
*/
void
SetError
(
PlayerError
type
,
Error
&&
error
);
void
ClearError
();
/**
* Checks whether an error has occurred, and if so, returns a
* copy of the #Error object.
*
* Caller must lock the object.
*/
gcc_pure
Error
GetError
()
const
{
Error
result
;
if
(
error_type
!=
PlayerError
::
NONE
)
result
.
Set
(
error
);
return
result
;
}
/**
* Returns the human-readable message describing the last
* error during playback, NULL if no error occurred. The
* caller has to free the returned string.
* Like GetError(), but locks and unlocks the object.
*/
char
*
GetErrorMessage
()
const
;
gcc_pure
Error
LockGetError
()
const
{
Lock
();
Error
result
=
GetError
();
Unlock
();
return
result
;
}
void
ClearError
();
PlayerError
GetErrorType
()
const
{
return
error_type
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment