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
2fed3b5e
Commit
2fed3b5e
authored
Jan 19, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input/Tidal*Request: add Start() method
The caller should be able to safely store the instance pointer before his callback is invoked.
parent
1ecad094
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
4 deletions
+14
-4
TidalInputPlugin.cxx
src/input/plugins/TidalInputPlugin.cxx
+1
-0
TidalLoginRequest.cxx
src/input/plugins/TidalLoginRequest.cxx
+0
-2
TidalLoginRequest.hxx
src/input/plugins/TidalLoginRequest.hxx
+6
-0
TidalSessionManager.cxx
src/input/plugins/TidalSessionManager.cxx
+1
-0
TidalTrackRequest.cxx
src/input/plugins/TidalTrackRequest.cxx
+0
-2
TidalTrackRequest.hxx
src/input/plugins/TidalTrackRequest.hxx
+6
-0
No files found.
src/input/plugins/TidalInputPlugin.cxx
View file @
2fed3b5e
...
...
@@ -91,6 +91,7 @@ TidalInputStream::OnTidalSession() noexcept
tidal_session
->
GetSession
().
c_str
(),
track_id
.
c_str
(),
handler
);
track_request
->
Start
();
}
catch
(...)
{
Failed
(
std
::
current_exception
());
}
...
...
src/input/plugins/TidalLoginRequest.cxx
View file @
2fed3b5e
...
...
@@ -59,8 +59,6 @@ TidalLoginRequest::TidalLoginRequest(CurlGlobal &curl,
request
.
SetOption
(
CURLOPT_COPYPOSTFIELDS
,
EncodeForm
(
request
.
Get
(),
{{
"username"
,
username
},
{
"password"
,
password
}}).
c_str
());
request
.
StartIndirect
();
}
TidalLoginRequest
::~
TidalLoginRequest
()
noexcept
...
...
src/input/plugins/TidalLoginRequest.hxx
View file @
2fed3b5e
...
...
@@ -44,6 +44,8 @@ public:
/**
* An asynchronous Tidal "login/username" request.
*
* After construction, call Start() to initiate the request.
*/
class
TidalLoginRequest
final
:
CurlResponseHandler
{
CurlSlist
request_headers
;
...
...
@@ -71,6 +73,10 @@ public:
~
TidalLoginRequest
()
noexcept
;
void
Start
()
{
request
.
StartIndirect
();
}
private
:
/* virtual methods from CurlResponseHandler */
void
OnHeaders
(
unsigned
status
,
...
...
src/input/plugins/TidalSessionManager.cxx
View file @
2fed3b5e
...
...
@@ -60,6 +60,7 @@ TidalSessionManager::AddLoginHandler(TidalSessionHandler &h) noexcept
token
,
username
,
password
,
handler
);
login_request
->
Start
();
}
catch
(...)
{
error
=
std
::
current_exception
();
ScheduleInvokeHandlers
();
...
...
src/input/plugins/TidalTrackRequest.cxx
View file @
2fed3b5e
...
...
@@ -61,8 +61,6 @@ TidalTrackRequest::TidalTrackRequest(CurlGlobal &curl,
request_headers
.
Append
((
std
::
string
(
"X-Tidal-SessionId:"
)
+
session
).
c_str
());
request
.
SetOption
(
CURLOPT_HTTPHEADER
,
request_headers
.
Get
());
request
.
StartIndirect
();
}
TidalTrackRequest
::~
TidalTrackRequest
()
noexcept
...
...
src/input/plugins/TidalTrackRequest.hxx
View file @
2fed3b5e
...
...
@@ -46,6 +46,8 @@ public:
/**
* An asynchronous request for the streaming URL of a Tidal track.
*
* After construction, call Start() to initiate the request.
*/
class
TidalTrackRequest
final
:
CurlResponseHandler
{
CurlSlist
request_headers
;
...
...
@@ -74,6 +76,10 @@ public:
~
TidalTrackRequest
()
noexcept
;
void
Start
()
{
request
.
StartIndirect
();
}
private
:
/* virtual methods from CurlResponseHandler */
void
OnHeaders
(
unsigned
status
,
...
...
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