|
|
|
@ -119,15 +119,20 @@ void MPDConnection::SetErrorHandler(ErrorHandler handler, void *data) |
|
|
|
itsErrorHandlerUserdata = data; |
|
|
|
itsErrorHandlerUserdata = data; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void MPDConnection::UpdateStatus() |
|
|
|
void MPDConnection::GetStatus() |
|
|
|
{ |
|
|
|
{ |
|
|
|
CheckForErrors(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (itsOldStatus) |
|
|
|
if (itsOldStatus) |
|
|
|
mpd_freeStatus(itsOldStatus); |
|
|
|
mpd_freeStatus(itsOldStatus); |
|
|
|
itsOldStatus = itsCurrentStatus; |
|
|
|
itsOldStatus = itsCurrentStatus; |
|
|
|
mpd_sendStatusCommand(itsConnection); |
|
|
|
mpd_sendStatusCommand(itsConnection); |
|
|
|
itsCurrentStatus = mpd_getStatus(itsConnection); |
|
|
|
itsCurrentStatus = mpd_getStatus(itsConnection); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MPDConnection::UpdateStatus() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
CheckForErrors(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GetStatus(); |
|
|
|
|
|
|
|
|
|
|
|
if (!itsMaxPlaylistLength) |
|
|
|
if (!itsMaxPlaylistLength) |
|
|
|
itsMaxPlaylistLength = GetPlaylistLength(); |
|
|
|
itsMaxPlaylistLength = GetPlaylistLength(); |
|
|
|
@ -182,6 +187,15 @@ void MPDConnection::UpdateDirectory(const string &path) const |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MPDConnection::Execute(const string &command) const |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (isConnected) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
mpd_executeCommand(itsConnection, command.c_str()); |
|
|
|
|
|
|
|
mpd_finishCommand(itsConnection); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void MPDConnection::Play() const |
|
|
|
void MPDConnection::Play() const |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (isConnected) |
|
|
|
if (isConnected) |
|
|
|
@ -842,7 +856,7 @@ int MPDConnection::CheckForErrors() |
|
|
|
itsErrorHandler(this, itsConnection->error, itsConnection->errorStr, itsErrorHandlerUserdata); |
|
|
|
itsErrorHandler(this, itsConnection->error, itsConnection->errorStr, itsErrorHandlerUserdata); |
|
|
|
itsErrorCode = itsConnection->error; |
|
|
|
itsErrorCode = itsConnection->error; |
|
|
|
} |
|
|
|
} |
|
|
|
itsLastErrorMessage = itsConnection->errorStr; |
|
|
|
itsErrorMessage = itsConnection->errorStr; |
|
|
|
mpd_clearError(itsConnection); |
|
|
|
mpd_clearError(itsConnection); |
|
|
|
} |
|
|
|
} |
|
|
|
return itsErrorCode; |
|
|
|
return itsErrorCode; |
|
|
|
|