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
b56bfbae
Commit
b56bfbae
authored
Jan 26, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input/tidal: add setting "audioquality"
parent
f55b1415
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
5 deletions
+26
-5
user.xml
doc/user.xml
+15
-0
TidalInputPlugin.cxx
src/input/plugins/TidalInputPlugin.cxx
+3
-1
TidalTrackRequest.cxx
src/input/plugins/TidalTrackRequest.cxx
+7
-4
TidalTrackRequest.hxx
src/input/plugins/TidalTrackRequest.hxx
+1
-0
No files found.
doc/user.xml
View file @
b56bfbae
...
@@ -2497,6 +2497,21 @@ run</programlisting>
...
@@ -2497,6 +2497,21 @@ run</programlisting>
The Tidal password.
The Tidal password.
</entry>
</entry>
</row>
</row>
<row>
<entry>
<varname>
audioquality
</varname>
<parameter>
Q
</parameter>
</entry>
<entry>
The Tidal "audioquality" parameter. Possible
values:
<parameter>
HI_RES
</parameter>
,
<parameter>
LOSSLESS
</parameter>
,
<parameter>
HIGH
</parameter>
,
<parameter>
LOW
</parameter>
. Default is
<parameter>
HIGH
</parameter>
.
</entry>
</row>
</tbody>
</tbody>
</tgroup>
</tgroup>
</informaltable>
</informaltable>
...
...
src/input/plugins/TidalInputPlugin.cxx
View file @
b56bfbae
...
@@ -40,6 +40,7 @@
...
@@ -40,6 +40,7 @@
static
constexpr
Domain
tidal_domain
(
"tidal"
);
static
constexpr
Domain
tidal_domain
(
"tidal"
);
static
TidalSessionManager
*
tidal_session
;
static
TidalSessionManager
*
tidal_session
;
static
const
char
*
tidal_audioquality
;
class
TidalInputStream
final
class
TidalInputStream
final
:
public
ProxyInputStream
,
TidalSessionHandler
,
TidalTrackHandler
{
:
public
ProxyInputStream
,
TidalSessionHandler
,
TidalTrackHandler
{
...
@@ -102,6 +103,7 @@ TidalInputStream::OnTidalSession() noexcept
...
@@ -102,6 +103,7 @@ TidalInputStream::OnTidalSession() noexcept
tidal_session
->
GetToken
(),
tidal_session
->
GetToken
(),
tidal_session
->
GetSession
().
c_str
(),
tidal_session
->
GetSession
().
c_str
(),
track_id
.
c_str
(),
track_id
.
c_str
(),
tidal_audioquality
,
handler
);
handler
);
track_request
->
Start
();
track_request
->
Start
();
}
catch
(...)
{
}
catch
(...)
{
...
@@ -178,7 +180,7 @@ InitTidalInput(EventLoop &event_loop, const ConfigBlock &block)
...
@@ -178,7 +180,7 @@ InitTidalInput(EventLoop &event_loop, const ConfigBlock &block)
if
(
password
==
nullptr
)
if
(
password
==
nullptr
)
throw
PluginUnavailable
(
"No Tidal password configured"
);
throw
PluginUnavailable
(
"No Tidal password configured"
);
// TODO: "audioquality" setting
tidal_audioquality
=
block
.
GetBlockValue
(
"audioquality"
,
"HIGH"
);
tidal_session
=
new
TidalSessionManager
(
event_loop
,
base_url
,
token
,
tidal_session
=
new
TidalSessionManager
(
event_loop
,
base_url
,
token
,
username
,
password
);
username
,
password
);
...
...
src/input/plugins/TidalTrackRequest.cxx
View file @
b56bfbae
...
@@ -63,21 +63,24 @@ public:
...
@@ -63,21 +63,24 @@ public:
};
};
static
std
::
string
static
std
::
string
MakeTrackUrl
(
const
char
*
base_url
,
const
char
*
track_id
)
MakeTrackUrl
(
const
char
*
base_url
,
const
char
*
track_id
,
const
char
*
audioquality
)
noexcept
{
{
// TODO: add "audioquality" parameter to this function
return
std
::
string
(
base_url
)
return
std
::
string
(
base_url
)
+
"/tracks/"
+
"/tracks/"
+
track_id
+
track_id
+
"/urlpostpaywall?assetpresentation=FULL&audioquality=LOW&urlusagemode=STREAM"
;
+
"/urlpostpaywall?assetpresentation=FULL&audioquality="
+
audioquality
+
"&urlusagemode=STREAM"
;
}
}
TidalTrackRequest
::
TidalTrackRequest
(
CurlGlobal
&
curl
,
TidalTrackRequest
::
TidalTrackRequest
(
CurlGlobal
&
curl
,
const
char
*
base_url
,
const
char
*
token
,
const
char
*
base_url
,
const
char
*
token
,
const
char
*
session
,
const
char
*
session
,
const
char
*
track_id
,
const
char
*
track_id
,
const
char
*
audioquality
,
TidalTrackHandler
&
_handler
)
TidalTrackHandler
&
_handler
)
:
request
(
curl
,
MakeTrackUrl
(
base_url
,
track_id
).
c_str
(),
*
this
),
:
request
(
curl
,
MakeTrackUrl
(
base_url
,
track_id
,
audioquality
).
c_str
(),
*
this
),
handler
(
_handler
)
handler
(
_handler
)
{
{
request_headers
.
Append
((
std
::
string
(
"X-Tidal-Token:"
)
request_headers
.
Append
((
std
::
string
(
"X-Tidal-Token:"
)
...
...
src/input/plugins/TidalTrackRequest.hxx
View file @
b56bfbae
...
@@ -55,6 +55,7 @@ public:
...
@@ -55,6 +55,7 @@ public:
const
char
*
base_url
,
const
char
*
token
,
const
char
*
base_url
,
const
char
*
token
,
const
char
*
session
,
const
char
*
session
,
const
char
*
track_id
,
const
char
*
track_id
,
const
char
*
audioquality
,
TidalTrackHandler
&
_handler
);
TidalTrackHandler
&
_handler
);
~
TidalTrackRequest
()
noexcept
;
~
TidalTrackRequest
()
noexcept
;
...
...
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