I've written MusicIP and Essentia/Musly DSTM mixers. These only work on local tracks, so if the queue has non-local I'd like to fall-through to using LastMix. But I cant seem to get that working. How can a DSTM mixer call another? I have the following function to call through to LastMix:
My DSTM mixer uses the above via:Code:sub _mixFailed { my ($client, $cb) = @_; if (exists $INC{'Plugins/LastMix/DontStopTheMusic.pm'}) { main::DEBUGLOG && $log->debug("Call through to LastMix"); Plugins::LastMix::DontStopTheMusic->please($client, $cb); } else { main::DEBUGLOG && $log->debug("Return empty list"); $cb->($client, []); } }
But LMS complains:Code:sub postinitPlugin { my $class = shift; if ( Slim::Utils::PluginManager->isEnabled('Slim::Plugin::DontStopTheMusic::Plugin') ) { require Slim::Plugin::DontStopTheMusic::Plugin; Slim::Plugin::DontStopTheMusic::Plugin->registerHandler('MIPMIXER_MIX', sub { my ($client, $cb) = @_; .... Slim::Networking::SimpleAsyncHTTP->new( sub { my $response = shift; main::DEBUGLOG && $log->debug("Recevied MIP response"); my $mix = _handleMipResponse($response->content); my @tracks = _getTracksFromMix(\@$mix, \@$previousTracks, \@seedsToUse, \%seedIdHash, \@seedGenres); if (scalar @tracks > 0) { $cb->($client, @tracks); } else { _mixFailed($client, $cb); } }, ...... } )->get($url); } else { _mixFailed($client, $cb); } } else { _mixFailed($client, $cb); } }); } }
Any ideas what's wrong?Code:[21-04-06 10:51:53.5072] Slim::Networking::IO::Select::__ANON__ (130) Error: Select task failed calling Slim::Networking::Async::HTTP::_http_read_body: Can't locate object method "master" via package "Plugins::LastMix::DontStopTheMusic" at /home/craig/Downloads/lms/Cache/InstalledPlugins/Plugins/LastMix/DontStopTheMusic.pm line 45.
Results 1 to 4 of 4
Thread: DSTM fallback?
-
2021-04-06, 02:58 #1
- Join Date
- Mar 2017
- Posts
- 3,500
DSTM fallback?
Material debug: 1. Launch via http: //SERVER:9000/material/?debug=json (Use http: //SERVER:9000/material/?debug=json,cometd to also see update messages, e.g. play queue) 2. Open browser's developer tools 3. Open console tab in developer tools 4. REQ/RESP messages sent to/from LMS will be logged here.
-
2021-04-06, 04:50 #2
DSTM fallback?
> Plugins::LastMix:
ontStopTheMusic->please($client, $cb);
You must call Plugins::LastMix:ontStopTheMusic:
lease($client, $cb)
(colons before "please", rather than the arrow notation). "please()" is
not a class function.
-
2021-04-06, 05:15 #3
- Join Date
- Mar 2017
- Posts
- 3,500
Material debug: 1. Launch via http: //SERVER:9000/material/?debug=json (Use http: //SERVER:9000/material/?debug=json,cometd to also see update messages, e.g. play queue) 2. Open browser's developer tools 3. Open console tab in developer tools 4. REQ/RESP messages sent to/from LMS will be logged here.
-
2021-04-06, 05:43 #4
DSTM fallback?
> D'Oh!!! That's so obvious! Now I feel stupid (and not for the first
> time!) Thanks, and sorry for asking and obvious question!
No worries!