Default Artwork if No Other

Find quick help here to get you started with Hollywood

Default Artwork if No Other

Postby 1Mouse » Sun Aug 05, 2012 9:26 am

I'd like to be able to load images from my HD via a $ in a text file.

I thought RawGet so that it could check the text for $ and if $ exists the display corresponding image but if no image on HD then display default.

Am I on the right track? and if so can someone assist please?
User avatar
1Mouse
 
Posts: 58
Joined: Sat Sep 11, 2010 9:27 pm

Re: Default Artwork if No Other

Postby Allanon » Mon Aug 06, 2012 9:47 am

Hi 1mouse,
to be honest I don't understand what do you mean with $, maybe a placeholder for the file to display in an external file?

If so you could structure a text file with your picture file entries, and place a default picture somewhere:

Suppose that:
text file with your images full path is : mypictures.txt
you default picture is : mydefaultpicture.jpg

Code: Select all
; *** simple loop/idea could be: ***

Local fid = FileOpen(Nil, "myprictures.txt", #MODE_READ)

While Not(Eof(fid))
   Local picpath = ReadLine(fid)
   If Exists(picpath)
      ; ---- HERE YOU PLACE YOUR CODE TO LOAD AND DISPLAY THE PICTURE <PICPATH>
   Else
      ; ---- HERE YOU PLACE YOUR CODE TO DISPLAY THE DEFAULT PICTURE <mydefaultpicture.jpg>
   EndIf
Wend

CloseFile(fid)



This is just an idea so you have something you can start working on :)
User avatar
Allanon
 
Posts: 413
Joined: Sun Feb 14, 2010 8:53 pm
Location: Italy

Re: Default Artwork if No Other

Postby 1Mouse » Mon Aug 06, 2012 9:25 pm

I've tried code:
/*** Display Artwork**/
Local cover = OpenFile(Nil, album2$, #MODE_READ)
While Not(Eof(cover))
Local picpath = ReadLine(cover)
If Exists
LoadBrush(4, album2$)
ScaleBrush(4, 130, 130)
DisplayBrush(4, 10, 10)
Else
DisplayBrush(9, 10, 10)
EndIf
Wend
CloseFile(cover)


It opens a file when coverart is available however I'm still getting an error when it tries to open an MP3 that has no coverart.

Brush4 is the coverart and Brush9 is the default missing artwork image

I know for sure that there are no problems with the mp3s I'm using.
User avatar
1Mouse
 
Posts: 58
Joined: Sat Sep 11, 2010 9:27 pm

Re: Default Artwork if No Other

Postby Allanon » Mon Aug 06, 2012 9:57 pm

Hi 1Mouse,
I will help you, but you have to help me understand what you are trying to do because your code is not clear to me :)
Please explain how you have organized the project, for example, album2$ what's supposed to store? The cover art file or the cover art filename?
Talking about MP3s, in which way you connect music with cover art?
User avatar
Allanon
 
Posts: 413
Joined: Sun Feb 14, 2010 8:53 pm
Location: Italy

Re: Default Artwork if No Other

Postby 1Mouse » Mon Aug 06, 2012 10:09 pm

I've used the ID3.hws routine and the tag in the ID3 is TALB, I used:
CreateTextObject(7, artist$)
ElseIf tag$ = "TALB"
Seek(1, FilePos(1) + 1) ; skip encoding
album$ = ReadString(1, framelen - 1)
album2$ = album$

album$ (becomes TextObject) is used to display the album title in text form and album2$ (becomes Brush) is used for the coverart which is save on the HD

So when I load an mp3 it reads the ID3 tag and displays text which is album$ and displays coverart which is album2$ which all works, however if the coverart isn't in the same folder then I get an error: Cannot Read File
User avatar
1Mouse
 
Posts: 58
Joined: Sat Sep 11, 2010 9:27 pm

Re: Default Artwork if No Other

Postby 1Mouse » Fri Mar 10, 2017 12:02 am

@all

I've advanced a little since 2012, however not as far as expected.

My Intune program now loads coverart when available and default artwork if none available, however I can't put the coverart in the same folder as the music it has to be in the root.

I get an error when the Mp3 ID3 tag has missing metadata, if the artist/album/track data is missing I get an error. If I load a track with all the data it plays fine and load a file with missing data that plays but on restart loading the file with missing data gives me an error.
User avatar
1Mouse
 
Posts: 58
Joined: Sat Sep 11, 2010 9:27 pm

Re: Default Artwork if No Other

Postby Juan Carlos » Fri Mar 10, 2017 3:19 pm

We have more examples like other languages this is the Hollywood problem, even I tryed to convert visual basic, javascrit and c but the language structure is very different and only with easy routines is possible, in my case I make different proyects to avoid stopped and leave this language, with beatyful examples but no useful to make normal apps.
User avatar
Juan Carlos
 
Posts: 396
Joined: Mon Sep 06, 2010 1:02 pm
Location: Palencia

Re: Default Artwork if No Other

Postby airsoftsoftwair » Sat Mar 11, 2017 3:35 pm

Keep in mind that the ID3.hws code from HollyAmp is a really, really rudimentary ID3 parser. It certainly doesn't handle all the intricacies of ID3 tags. This code needs a lot of improvement in order to be compatible with all ID3 features...
User avatar
airsoftsoftwair
 
Posts: 2238
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany

Re: Default Artwork if No Other

Postby 1Mouse » Sun Mar 12, 2017 3:37 pm

At present if there is missing ID3 metadata I get an error rather than my software displaying nothing
User avatar
1Mouse
 
Posts: 58
Joined: Sat Sep 11, 2010 9:27 pm

Re: Default Artwork if No Other

Postby airsoftsoftwair » Wed Mar 15, 2017 1:28 am

Maybe the ID3 recognizer isn't that stable... as I said, that code really implements just a rudimentary parser...
User avatar
airsoftsoftwair
 
Posts: 2238
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany

Next

Return to Newbie questions

Who is online

Users browsing this forum: Yahoo [Bot] and 3 guests