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
7 years ago
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input/tidal: add setting "audioquality"
parent
f55b1415
sisyphus
0.23.15-alt1
0.23.14-alt1
0.23.13-alt1
0.23.12-alt1
0.23.11-alt1
0.23.8-alt3
0.23.8-alt2
0.23.8-alt1
0.21.24-alt1.1
0.21.24-alt1
gb-sisyphus-task339776.6100
gb-sisyphus-task337393.100
gb-sisyphus-task337176.300
gb-sisyphus-task334590.100
gb-sisyphus-task333607.100
gb-sisyphus-task331543.2500
gb-sisyphus-task328663.4700
gb-sisyphus-task325064.100
gb-sisyphus-task319111.4000
gb-sisyphus-task313704.100
gb-sisyphus-task312885.100
gb-sisyphus-task308905.3200
gb-sisyphus-task305294.500
gb-sisyphus-task304007.100
gb-sisyphus-task303674.1700
gb-sisyphus-task298681.300
gb-sisyphus-task296051.1000
gb-sisyphus-task274827.100
gb-sisyphus-task269249.2000
gb-sisyphus-task266579.400
gb-sisyphus-task258132.600
gb-sisyphus-task254601.200
No related merge requests found
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>
The Tidal password.
</entry>
</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>
</tgroup>
</informaltable>
...
...
This diff is collapsed.
Click to expand it.
src/input/plugins/TidalInputPlugin.cxx
View file @
b56bfbae
...
...
@@ -40,6 +40,7 @@
static
constexpr
Domain
tidal_domain
(
"tidal"
);
static
TidalSessionManager
*
tidal_session
;
static
const
char
*
tidal_audioquality
;
class
TidalInputStream
final
:
public
ProxyInputStream
,
TidalSessionHandler
,
TidalTrackHandler
{
...
...
@@ -102,6 +103,7 @@ TidalInputStream::OnTidalSession() noexcept
tidal_session
->
GetToken
(),
tidal_session
->
GetSession
().
c_str
(),
track_id
.
c_str
(),
tidal_audioquality
,
handler
);
track_request
->
Start
();
}
catch
(...)
{
...
...
@@ -178,7 +180,7 @@ InitTidalInput(EventLoop &event_loop, const ConfigBlock &block)
if
(
password
==
nullptr
)
throw
PluginUnavailable
(
"No Tidal password configured"
);
// TODO: "audioquality" setting
tidal_audioquality
=
block
.
GetBlockValue
(
"audioquality"
,
"HIGH"
);
tidal_session
=
new
TidalSessionManager
(
event_loop
,
base_url
,
token
,
username
,
password
);
...
...
This diff is collapsed.
Click to expand it.
src/input/plugins/TidalTrackRequest.cxx
View file @
b56bfbae
...
...
@@ -63,21 +63,24 @@ public:
};
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
)
+
"/tracks/"
+
track_id
+
"/urlpostpaywall?assetpresentation=FULL&audioquality=LOW&urlusagemode=STREAM"
;
+
"/urlpostpaywall?assetpresentation=FULL&audioquality="
+
audioquality
+
"&urlusagemode=STREAM"
;
}
TidalTrackRequest
::
TidalTrackRequest
(
CurlGlobal
&
curl
,
const
char
*
base_url
,
const
char
*
token
,
const
char
*
session
,
const
char
*
track_id
,
const
char
*
audioquality
,
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
)
{
request_headers
.
Append
((
std
::
string
(
"X-Tidal-Token:"
)
...
...
This diff is collapsed.
Click to expand it.
src/input/plugins/TidalTrackRequest.hxx
View file @
b56bfbae
...
...
@@ -55,6 +55,7 @@ public:
const
char
*
base_url
,
const
char
*
token
,
const
char
*
session
,
const
char
*
track_id
,
const
char
*
audioquality
,
TidalTrackHandler
&
_handler
);
~
TidalTrackRequest
()
noexcept
;
...
...
This diff is collapsed.
Click to expand it.
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