Show/remove non-existent files

The Tuniac forum.
Post Reply
Johnny
Posts: 8
Joined: Mon Jul 25, 2011 3:25 pm

Show/remove non-existent files

Post by Johnny » Sun Sep 18, 2011 1:18 pm

So currently, if a file ceases to exist in a playlist (say if you rename or delete it) when you try and play it, it gets skipped (I think the same thing happens in the media library).
However if you queue it, then playback altogether stops (maybe that should get fixed).

But anyway, it would be kinda cool if you could tell which files no longer exist, like if a little red cross appears next to them or something (even if you had to select something like "update all files").
On that same note, it would also be cool if there was an option to remove these non-existent files (kinda like there's an option to remove duplicates).

Mainly posting here 'cause Brett isn't on MSN and I don't want to forget.

Harteex
Posts: 80
Joined: Tue Mar 30, 2010 7:23 pm

Re: Show/remove non-existent files

Post by Harteex » Tue Sep 20, 2011 11:14 pm

Johnny wrote: But anyway, it would be kinda cool if you could tell which files no longer exist, like if a little red cross appears next to them or something (even if you had to select something like "update all files").
Maybe using gray color and italic for non-existant files :)

Brett
Site Admin
Posts: 250
Joined: Sun Mar 28, 2010 12:36 am

Re: Show/remove non-existent files

Post by Brett » Sat Sep 24, 2011 1:37 am

Maybe one of you more than capable programmers could actually do this :)

Johnny
Posts: 8
Joined: Mon Jul 25, 2011 3:25 pm

Re: Show/remove non-existent files

Post by Johnny » Sat Sep 24, 2011 6:58 am

Harteex wrote:Maybe using gray color and italic for non-existant files :)
That would also work.
Brett wrote:Maybe one of you more than capable programmers could actually do this :)
But then you wouldn't have the pleasure of implementing it yourself! :P
(plus I'm completely unfamiliar with tuniac's code base)

Brett
Site Admin
Posts: 250
Joined: Sun Mar 28, 2010 12:36 am

Re: Show/remove non-existent files

Post by Brett » Sat Sep 24, 2011 10:03 am

But I'll give you a head start.

A Library Entry already has a field in the current db for availability(unsigned long dwAvailablility), it will be currently set as 0 for all files and is currently not used anywhere in Tuniac.

LibraryEntry.h already defines:
#define AVAILABLILITY_AVAILABLE 0
#define AVAILABLILITY_UNAVAILABLE 1
#define AVAILABLILITY_UNKNOWN 2

IAudioSource.h needs a new define:
#define FIELD_AVAILABILITY 26



Currently in MediaLibraryPlaylistEntry.cpp things such as GetFieldNumber() and SetFieldNumber() have no access to the availability field and would need a quick update to support adjusting the field.

TuniacApp.cpp line 852 is of interest to catch the failed playback state.
NOTIFY_COREAUDIO_PLAYBACKFAILED message is sent from audio engine if the file is unplayable(likely invalid/corrupt or not available)

And at line 933
NOTIFY_COREAUDIO_PLAYBACKSTARTED could be used for if the file ever successfully plays again in the future.

Then you just need to set a style for things that have availability set as AVAILABLILITY_UNAVAILABLE.
I think you would do this in PlaylistSourceView.cpp around line 1405 in LVN_GETDISPINFO

Code: Select all

IPlaylist * pPlaylist = m_PlaylistManager.GetActivePlaylist();
if(pPlaylist)
{
  IPlaylistEntry * pEntry = pPlaylist->GetActiveEntry();
  if(pEntry)
  {
    pEntry->SetFieldNumber(FIELD_AVAILABILITY, AVAILABLILITY_UNAVAILABLE);
    //redraw window
    m_SourceSelectorWindow->UpdateView();
  }

}

Brett
Site Admin
Posts: 250
Joined: Sun Mar 28, 2010 12:36 am

Re: Show/remove non-existent files

Post by Brett » Thu Sep 29, 2011 2:07 pm

you guys are slacker than me :(


try 110929:
-add "x" image for unavailable files.
http://www.wasteofcash.com/Tuniac/

jacoby
Posts: 33
Joined: Mon Mar 29, 2010 1:00 am

Re: Show/remove non-existent files

Post by jacoby » Thu Sep 29, 2011 7:09 pm

Does it handle unavailable files any different?

Now that unavailable files are marked, it should be pretty easy to add a 'remove missing files' option or something like that, right?

Harteex
Posts: 80
Joined: Tue Mar 30, 2010 7:23 pm

Re: Show/remove non-existent files

Post by Harteex » Thu Sep 29, 2011 8:48 pm

Brett wrote:Maybe one of you more than capable programmers could actually do this :)
I'd love to do some coding on Tuniac at some point, but now time is really a problem :(

Brett
Site Admin
Posts: 250
Joined: Sun Mar 28, 2010 12:36 am

Re: Show/remove non-existent files

Post by Brett » Thu Sep 29, 2011 11:03 pm

jacoby wrote:Does it handle unavailable files any different?

Now that unavailable files are marked, it should be pretty easy to add a 'remove missing files' option or something like that, right?
Sure, you could do add that :)
Easiest would be I make the "rebuild media library" under prefs remove files that are unavailable.

PS. 110929 code is not in svn yet, I wanted us to test this code a bit and see that it behaves right first :)

Post Reply