MultiMedia Soft forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

SMF - Just Installed!

Author Topic: PlayListExecOrderTableGet returns wrong values  (Read 28 times)

PatrickVossen

  • Newbie
  • *
  • Posts: 25
    • View Profile
PlayListExecOrderTableGet returns wrong values
« on: February 22, 2021, 04:00:00 PM »

Hi,

Retrieving the shuffled playlist order does not seem to work.

I have a playlist that's loaded from .pdj file containing 3 files (using PlayListLoadSync, PlayListLoad does not seem to work at all).
The PlaylistSetShuffle option is set to true (was already set before loading the pdj-file).
On the PlayListLoadDone-event, I do a call to PlayListExecOrderTableGet to retrieve the PlayOrder.
Result for this is    2 - 1 - 0
The playlist starts playing and on the PlaylistSoundLoaded-event I log the indexes that are played.
The result for this is    2 - 0 - 1

Grtz
Patrick Vossen
Logged

Administrator

  • Administrator
  • Sr. Member
  • *****
  • Posts: 291
    • View Profile
    • MultiMedia Soft
Re: PlayListExecOrderTableGet returns wrong values
« Reply #1 on: February 27, 2021, 01:15:51 AM »

Hello Patrick,

we will try to replicate the issue and will let you know our findings at the soonest.

Kind Regards

Severino Delaurenti
MultiMedia Soft
Logged

Administrator

  • Administrator
  • Sr. Member
  • *****
  • Posts: 291
    • View Profile
    • MultiMedia Soft
Re: PlayListExecOrderTableGet returns wrong values
« Reply #2 on: February 27, 2021, 02:43:36 PM »

Hello Patrick,

could you be so kind to tell me which method are you currently using for starting execution of the playlist?

Kind regards

Severino Delaurenti
MultiMedia Soft
Logged

Administrator

  • Administrator
  • Sr. Member
  • *****
  • Posts: 291
    • View Profile
    • MultiMedia Soft
Re: PlayListExecOrderTableGet returns wrong values
« Reply #3 on: February 27, 2021, 03:47:12 PM »

Hello again,

with regards to the other fact you mentioned, that the PlayListLoad method doesn't seem to work, please, be advised that, accordingly to the documentation, the PlayListLoadDone event is only generated when using the PlayListLoadSync method so in case you should perform coding inside the event handler, this code won't be reachable due to the fact that the PlayListLoadDone event is not generated by the PlayListLoad method: you should transfer the handler's code immediately after invoking the PlayListLoad method.

Kind Regards

Severino Delaurenti
MultiMedia Soft
Logged

PatrickVossen

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: PlayListExecOrderTableGet returns wrong values
« Reply #4 on: March 01, 2021, 09:27:23 AM »

Hi Severino,

For starting the playlist, I have tried :
        AudioDjStudio1.PlayListExecute(Player_1, True)
        AudioDjStudio1.PlayListExecute(Player_1, False)
        AudioDjStudio1.PlayListExecAt(Player_1, IndexOrder(0))
        AudioDjStudio1.PlayListExecAt(Player_1, 0)

I have added my vb code and the playlist (.pdj) I have used

Code: [Select]
Imports AudioDjStudio

Public Class Form1
    Private Const Player_1 As Short = 0

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim ofd As New OpenFileDialog With {
            .Filter = "Playlist formats (*.m3u;*.pls;*.wpl;*.pdj)|*.m3u;*.pls;*.wpl;*.pdj|M3U PlayList (*.m3u)|*.m3u|PLS PlayList (*.pls)|*.pls|WPL PlayList (*.wpl)|*.wpl|PDJ PlayList (*.pdj)|*.pdj|All files (*.*)|*.*",
            .InitialDirectory = AudioDjStudio1.SoundsDirectory
        }
        If ofd.ShowDialog() <> DialogResult.OK Then Return

        If AudioDjStudio1.PlayListLoadSync(Player_1, ofd.FileName, enumPlayListModes.PLAYLIST_AUTOMATION_MODE) <> enumErrorCodes.NOERROR Then
            MessageBox.Show("Error loading playlist")
            Return
        End If
    End Sub

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        AudioDjStudio1.InitSoundSystem(1, 0, 0, 0, 0, -1)

        AudioDjStudio1.PlayListSetLoop(Player_1, False)
        AudioDjStudio1.PlayListSetShuffle(Player_1, True)
    End Sub

    Private Sub AudioDjStudio1_PlayListLoadDone(sender As Object, e As PlayListLoadDoneEventArgs) Handles AudioDjStudio1.PlayListLoadDone
        Debug.WriteLine($"AudioDjStudio1_PlayListLoadDone   nPlayerIndex={e.nPlayerIndex}   bSuccess={e.bSuccess}")

        Dim Quantity As Short = AudioDjStudio1.PlayListGetCount(Player_1)
        Dim IndexOrder() As Short
        If Quantity > 0 Then
            ReDim IndexOrder(Quantity - 1)
            Debug.WriteLine(AudioDjStudio1.PlayListExecOrderTableGet(Player_1, IndexOrder, Quantity).ToString)
            Debug.WriteLine("+++++++++++++++++++++++++++++++")
            For index As Integer = 0 To IndexOrder.Length - 1
                Debug.WriteLine(IndexOrder(index))
            Next
            Debug.WriteLine("+++++++++++++++++++++++++++++++")
        End If
        AudioDjStudio1.PlayListExecute(Player_1, True)
        'AudioDjStudio1.PlayListExecute(Player_1, False)
        'AudioDjStudio1.PlayListExecAt(Player_1, IndexOrder(0))
        'AudioDjStudio1.PlayListExecAt(Player_1, 0)

    End Sub

    Private Sub AudioDjStudio1_PlayListLoadPerc(sender As Object, e As PlayListLoadPercEventArgs) Handles AudioDjStudio1.PlayListLoadPerc
        Debug.WriteLine($"AudioDjStudio1_PlayListLoadPerc   nPlayerIndex={e.nPlayerIndex}   nPercentage={e.nPercentage}")
    End Sub

    Private Sub AudioDjStudio1_PlayListLoadStart(sender As Object, e As PlayerEventArgs) Handles AudioDjStudio1.PlayListLoadStart
        Debug.WriteLine($"AudioDjStudio1_PlayListLoadStart   nPlayerIndex={e.nPlayerIndex}")
    End Sub

    Private Sub AudioDjStudio1_PlayListDone(sender As Object, e As PlayerEventArgs) Handles AudioDjStudio1.PlayListDone
        Debug.WriteLine($"AudioDjStudio1_PlayListDone   nPlayerIndex={e.nPlayerIndex}")
    End Sub

    Private Sub AudioDjStudio1_PlaylistSoundLoaded(sender As Object, e As PlaylistSoundLoadedEventArgs) Handles AudioDjStudio1.PlaylistSoundLoaded
        Debug.WriteLine($"AudioDjStudio1_PlaylistSoundLoaded   nPlayerIndex={e.nPlayerIndex}   nItemIndex={e.nItemIndex}   strTag={e.strTag}")
    End Sub

    Private Sub AudioDjStudio1_PlayListSoundLoadFailure(sender As Object, e As SoundLoadedEventArgs) Handles AudioDjStudio1.PlayListSoundLoadFailure
        Debug.WriteLine($"AudioDjStudio1_PlayListSoundLoadFailure   nPlayerIndex={e.nPlayerIndex}   nItemIndex={e.nItemIndex}")
    End Sub
End Class
Logged

Administrator

  • Administrator
  • Sr. Member
  • *****
  • Posts: 291
    • View Profile
    • MultiMedia Soft
Re: PlayListExecOrderTableGet returns wrong values
« Reply #5 on: March 01, 2021, 10:39:11 AM »

Hello Patrick,

unfortunately this is not well explained inside the documentation but, by design, both the PlayListExecute and PlayListExecAt methods will cause a new shuffle of the loaded playlist so you should invoke the PlayListExecOrderTableGet method again after their call: differently from meniotned methods, using the PlayListExecNext method will not request a new shuffle.

Hope this helps

Kind Regards

Severino Delaurenti
MultiMedia Soft

Logged