Merge lp://qastaging/~mixxxdevelopers/mixxx/features_cuefile into lp://qastaging/~mixxxdevelopers/mixxx/trunk

Proposed by Phillip Whelan
Status: Merged
Merged at revision: 2699
Proposed branch: lp://qastaging/~mixxxdevelopers/mixxx/features_cuefile
Merge into: lp://qastaging/~mixxxdevelopers/mixxx/trunk
Diff against target: 1231 lines (+552/-272)
9 files modified
mixxx/src/dlgprefrecord.cpp (+43/-0)
mixxx/src/dlgprefrecord.h (+3/-0)
mixxx/src/dlgprefrecorddlg.ui (+57/-0)
mixxx/src/engine/engineshoutcast.cpp (+170/-251)
mixxx/src/engine/engineshoutcast.h (+1/-4)
mixxx/src/playerinfo.cpp (+97/-8)
mixxx/src/playerinfo.h (+11/-0)
mixxx/src/recording/enginerecord.cpp (+151/-9)
mixxx/src/recording/enginerecord.h (+19/-0)
To merge this branch: bzr merge lp://qastaging/~mixxxdevelopers/mixxx/features_cuefile
Reviewer Review Type Date Requested Status
RJ Skerry-Ryan Approve
Review via email: mp+51662@code.qastaging.launchpad.net

Description of the change

This adds support for generating CUE files when recording. This file can be used to split the recording or to generate playlists.

To post a comment you must log in.
Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

Hey Phil,

Really sorry for taking so long to get to this! This all looks nice, I just have some general issues with lack of n-deck support and the duplication between EngineShoutcast and EngineRecord:

- The metadata recording is hard coded to work with only 2 decks. I'd really rather not add more 2-deck code if we don't have to. Can you use the [Master],num_decks control (alternatively, thread the PlayerManager into EngineRecord)? Every deck has an "orientation" control which indicates the side of the crossfader it is attached to. You can use this in conjunction with its volume/pregain faders to figure out if they are "hearable". PlayerInfo is N-Deck ready, so that shouldn't be a problem.

- Assuming you'll change this given the above comment anyway, but ControlObject::getControl shouldn't be used in code that gets called on a schedule. As written it'll be doing 5 locks of the global ControlObject static mutex per call (plus 5 hash lookups) to getActiveTracks() when it could be written just a little more verbosely to get 0 per call.

- There's now a fair amount of duplicated code between EngineShoutcast and EngineRecord. Can you pull the current-metadata-detection code out into a common class that they both use? You could even build it into the PlayerInfo singleton class since that already exists.

- Minor nit: EngineRecord::m_pMetaDataLife is an int so its prefix should be m_iMetaDataFile

- Maybe pull 5000 out into a constant? UPDATE_RATE_MS or something. also add a comment about what it is

thanks,
RJ

review: Needs Fixing
2626. By Phillip Whelan

Merging from Trunk.

Revision history for this message
RAFFI TEA (raffitea) wrote :

Hey Philip,

there's a singleton PlayerInfo class that EngineShoutcast uses to get track information per deck. Maybe you can extract metadata recording in there. This would be of great benefit for the library history feature, too.

Revision history for this message
Phillip Whelan (pwhelan) wrote :

Right now I am moving the 'Current Track' functionality into PlayerInfo.

I was planning on using a timestamp to make sure it updates at most once per X seconds. If another call is made within that timeframe it returns the last answer it made.

2627. By Phillip Whelan

Move all the Current Deck code into PlayerInfo. Make it N-deck aware.

  * Add the getCurrentPlayingDeck method to PlayerInfo:
      Returns the deck number of the loudest active deck.
  * Add the getCurrentPlayingTrack method to PlayerInfo.
  * Refactor EngineRecord to query PlayerInfo for the current track.
  * Refactor EngineShoutCast to query Playerinfo for the current track.
  * Change instances of m_pMetadataLife to m_iMetadataLife.

2628. By Phillip Whelan

Make getCurrentPlayingDeck method thread safe with a Mutex. getCurrentPlayingTrack does not need a Mutex since it calls mutex'd methods and uses no other state itself.

Revision history for this message
Phillip Whelan (pwhelan) wrote :

I moved all the functionality into PlayefInfo and refactored EngineRecord and EngineShoutCast to use it.

Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

Awesome -- looks good for merging. I found these two issues:

1) TrackInfoObject::getId() only works for Mixxx library tracks. It won't work for tracks loaded from Rhythmbox, iTunes, Traktor, or Browse tracks, since all their IDs are -1. This might change in the future, but the best way is to probably just compare the TrackPointers directly. You're guaranteed that for tracks in the Mixxx library, there is only one TrackInfoObject* that exists for it, so QSharedPointer::operator= will work to tell if it's the same track. RB, iTunes, Traktor and Browse don't work this way, but at least they could be made to work that way when/if they ever keep track of the TIO's that they create. I would change all uses of getId() to compare the TrackPointers directly.

2) I tried out the cuefile recording and it didn't pick up 2 out of the 4 tracks I played. I think the problem is the math in PlayerInfo::getCurrentPlayingDeck. All the volume values are integers, while the engine volume values are 0.0 to 1.0 and the crossfader is -1.0 to 1.0, so these will get rounded off in integer conversion. Also, I think the xfvol calculation is slightly off since the orientation controls have non-intuitive values: left is 0, center is 1, right is 2.

This value for the xfval calculation worked for me (all 6 tracks I played got recorded in the correct order):

xfvol = 1 - 0.5 * fabs(m_listCOOrientation[chan]->get() - 1.0 - m_COxfader->get());

It maps tracks opposite from each other (e.g. oriented right crossfader left and vice-versa) to 0.0, and tracks that are exactly aligned w/ the crossfader (left/left, center/center, or right/right) to 1.0.

review: Approve
2629. By Phillip Whelan

FIX: get xfader code to work orientation values; left = 0, right = 2.

2630. By Phillip Whelan

FIX: take into account that TrackInfoObject->getId() == -1 for external track sources.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.