Inconistent behavior of queue clearing when adding tracks to it after exit from TCMP, not clear info on it in Help

Support for Android version of Total Commander

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Inconistent behavior of queue clearing when adding tracks to it after exit from TCMP, not clear info on it in Help

Post by *DrShark »

At first, I'll descrribe the actual behavior of what I assume is intentional (though the Help is not clear on this, and I'll return to this in second part of this post).
It's not necessary now, but for convenience of reproducing actual "buggy" behavior later, add buttons with following commands to TC4A button bar next to each other:
137 (TC Media Player)
139 (Enquene selected)

Now do following:
1) select 2 media files (put checkmark no their icons),
2) press button with command 139;
3) press button with command 139, so to get now 4 tracks in playlist, and you gen add more if you want;
4) press button with command 137;
5) press red X button in player (you can also use player's Main menu->Exit or the X button in player's notification in Android Notification drawer);
6) press button 139;
7) make some pause (to avoid "buggy" behavior I'll describe below), but no need to wait for all 10 seconds mentioned in the Notification;
8) press button 137:
you'll see only 2 tracks in queue playlist no matter how many you added in steps 2-3 above.
Actually the same happens no matter what way of opening/adding files you use - it doesn't have to be command 139, as long as before adding/opening file(s) you had the player closed as described in step 5: in this case files are added into clear queue.

The "buggy" behavior:
in step 5 exit the player in mentioned ways except the notification one,
and skip step 7 (the pause between the click on buttons with commands 139 and 137):
files will be added to current (not clear!) queue.
The only reason I'm calling this behavior "buggy" because if exit happens from Notification's "x" button, the files are added to clear queue no matter how quicly you'll the buttons with commands 139 and 137.

In the Help, the behavior which I mentioned as "intentional" is described incorrectly, actually what it stats is wrong and what is expected form that statement in not what actually happens. I'll quote it:
Total Commander for Android Help wrote: What's new in Total Commander/Android 2.60 final:
[...]
•MediaPlayer notifications: Small "x" button to directly close the player

TC Media Player
[...]
Main menu:
[...]
•Exit: Close player
[...]
exitbtn.png Close player and delete queue.
So what it says that if to close the player with red X button, the queue will be cleared.
However, this is not true:
if to start player while not adding tracks to it, e.g. by just clicking Player's notification or using the button with command 137, the whole queue playlist will still be there.
I understand that queue clearing works this way to aviod empty queue playlist (which is not intuitive or well-known feature of TC Media Player), but this should be described in clear way in the Help to avoid confusion, e.g.:
What's new in Total Commander/Android 2.60 final:
[...]
•MediaPlayer notifications: Small "x" button to directly close the player. After closing the new files are added to a clear queue.

TC Media Player
[...]
Main menu:
[...]
•Exit: Close player. New files then will be added to a clear queue.
[...]
exitbtn.png Close player. New files then will be added to a clear queue.
queue.
This way it will describe the actual behavior of the player. Maybe it's possibe to use better wording there, but there should be clear of what to expect after closing player in above ways.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Inconistent behavior of queue clearing when adding tracks to it after exit from TCMP, not clear info on it in Help

Post by *ghisler(Author) »

I have troubles reproducing what you described above, especially step 7:
7) make some pause (to avoid "buggy" behavior I'll describe below), but no need to wait for all 10 seconds mentioned in the Notification;
What does it mean? After step 6, the media player is in the foreground with 4 tracks, but not playing anything.
Therefore step 7 makes no sense, I cannot pause because nothing is playing. I tried these steps instead:
7a) Click "Play"
7b) Click "Pause"
7c) Click "X" button to close player and return to TC

But when I now click command 137 as in your step 8, the player re-opens with all 4 tracks as before.
So could you explain what you mean with step 7?

Or maybe step 8 should be "click command 139 and then 137"?

Anyway, the idea of the queue is as follows:
a) if the player was just moved to the background via home or back button or a task switch, the queue is not cleared
b) if the player was closed via "x", the queue is cleared. Appending will now start with a fresh queue
Author of Total Commander
https://www.ghisler.com
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: Inconistent behavior of queue clearing when adding tracks to it after exit from TCMP, not clear info on it in Help

Post by *DrShark »

ghisler(Author) wrote: 2020-09-06, 10:17 UTCAfter step 6, the media player is in the foreground with 4 tracks, but not playing anything.
Here after closing player with red X (step 5) and following command 139 (step 6) player does't go to foreground.
To avoid confusion and to simplify explanation, it's better to start with
step 0: close the player with red X, so player window disappears and playlist is ready to be cleared if new files will be added to queue.
So following happens with rest of steps above:
Steps 1, 2 - selecting 2 media files in TC4A and following command 139 - we get a queue with 2 files, TC4A window is still in foreground.
Step 3 - we're adding 2 more tracks to playlsit from TC4A using command 139, file manager window is still in foreground.
Step 4 - command 137 - now we're bringing the player window, which has 4 tracks, to foreground.
Step 5 - with red X button in a player we're closing a player window and prepearing queue to be clear if new files will be added to it.
Step 6 - command 139 in TC4A - 2 files should appear in fresh queue, but the file manager window is in background.
Step 7 - by "make some pause" I don't mean to press pause in player, I literally mean wait a bit, don't go to step 8 immediately.
Step 8 - press button 137 - bring the player to foreground.
So if you're making the pause as mentioned above in step 7, in step 8 you'll see the 2 files you added in step 6 will go to fresh queue.
If there is no pause, and you're immediately pressing button with command 137 (step 8) after previously pressed one with command 139 (step 6), your files will be added to already existing (not cleared) queue.
ghisler(Author) wrote: 2020-09-06, 10:17 UTCAnyway, the idea of the queue is as follows:
a) if the player was just moved to the background via home or back button or a task switch, the queue is not cleared
b) if the player was closed via "x", the queue is cleared. Appending will now start with a fresh queue
Yes, and this should be described in Help in a clear way. Even your explanation above is not clear enough, it's better to write:
"b) if the player was closed via "x", appending new file will now start with a in a fresh queue"
because the queue is not cleared unless the new file is added to it.
Last edited by DrShark on 2020-09-07, 08:16 UTC, edited 1 time in total.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Inconistent behavior of queue clearing when adding tracks to it after exit from TCMP, not clear info on it in Help

Post by *ghisler(Author) »

I have tried your new steps, but still can't reproduce the problem:
Step 6 - command 139 in TC4A - 2 files should appear in fresh queue, but the file manager window is in background.
What do you mean with "the file manager window is in background"? When I press command 139 here, the icon of the player in the notification bar changes from "x" (=closing player with delay) to square (=stopped).
Step 7 - by "make some pause" I don't mean to press pause in player, I literally mean wait a bit, don't go to step 8 immediately.
Even when I press button 139 and 137 within 1/10 of a second, I only get the two files added in step 6.

The only way to get the old list back is by clicking button 137 after clicking the 'x' button. But even then it doesn't matter whether I click button 137 immediately after clicking 'x', or wait until the 'x' notification disappears.

As long as you don't try to play or add something new, the old queue is remembered.
Author of Total Commander
https://www.ghisler.com
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: Inconistent behavior of queue clearing when adding tracks to it after exit from TCMP, not clear info on it in Help

Post by *DrShark »

ghisler(Author) wrote: 2020-09-07, 07:44 UTCI have tried your new steps, but still can't reproduce the problem:
Step 6 - command 139 in TC4A - 2 files should appear in fresh queue, but the file manager window is in background.
What do you mean with "the file manager window is in background"? When I press command 139 here, the icon of the player in the notification bar changes from "x" (=closing player with delay) to square (=stopped).
Sorry, I meant the file manager is in foreground!
ghisler(Author) wrote: 2020-09-07, 07:44 UTC
Step 7 - by "make some pause" I don't mean to press pause in player, I literally mean wait a bit, don't go to step 8 immediately.
Even when I press button 139 and 137 within 1/10 of a second, I only get the two files added in step 6.
I just reproduced this in Bluestacks emulator:
exit player by pressing X in it, mark 2 files, add them with command 139,
then repeat: close player again with X and comands 139, 137 with mouse clicks on their buttons as quickly as possible - the files are added to current queue instead of fresh one.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Inconistent behavior of queue clearing when adding tracks to it after exit from TCMP, not clear info on it in Help

Post by *ghisler(Author) »

I was able to reproduce it now on another device: It's a timing problem. The problem is that when you click button 139 while the player is in the delayed closing state, TC has to tell the player to abort the closing. Then it waits for about half a second to be sure the player doesn't close, and then it sends the files. When you click on button 137 within this short moment, the list hasn't been cleared yet, and the files are appened. I managed to fix this now by reducing the wait time to 200ms and waiting 250ms after you click button 139, so you can't click 137 so quickly afterwards.
Author of Total Commander
https://www.ghisler.com
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: Inconistent behavior of queue clearing when adding tracks to it after exit from TCMP, not clear info on it in Help

Post by *DrShark »

ghisler(Author) wrote: 2020-09-06, 10:17 UTC Anyway, the idea of the queue is as follows:
a) if the player was just moved to the background via home or back button or a task switch, the queue is not cleared
b) if the player was closed via "x", the queue is cleared. Appending will now start with a fresh queue
As for "b", the queue is also cleared if to add file to TC Media Player activity before TC start: exit from TC using command 155 killProcess, or reboot device, don't start TC, in some other app open media file wirh TC Media Player - it will be added to clear queue! Of course this is by design, but I would prefer that if file is passed to TC Media Player activity before actual start of TC itself, Media Player would ask user whether to add file to old or to fresh queue, or even cancel adding file, or at least behavior for such case could be set in Player settings. Please consider this as a feaure request for future TC versions.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
Post Reply