Default Artwork if No Other
Default Artwork if No Other
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?
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?
Re: Default Artwork if No Other
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
This is just an idea so you have something you can start working on
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
----------------------------
[Allanon] Fabio Falcucci | GitHub for recent works | Support me on Patreon for Hollywood libraries | ☆★ All my links ★☆
[Allanon] Fabio Falcucci | GitHub for recent works | Support me on Patreon for Hollywood libraries | ☆★ All my links ★☆
Re: Default Artwork if No Other
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.
/*** 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.
Re: Default Artwork if No Other
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?
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?
----------------------------
[Allanon] Fabio Falcucci | GitHub for recent works | Support me on Patreon for Hollywood libraries | ☆★ All my links ★☆
[Allanon] Fabio Falcucci | GitHub for recent works | Support me on Patreon for Hollywood libraries | ☆★ All my links ★☆
Re: Default Artwork if No Other
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
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
Re: Default Artwork if No Other
@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.
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.
- Juan Carlos
- Posts: 891
- Joined: Mon Sep 06, 2010 1:02 pm
Re: Default Artwork if No Other
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.
- airsoftsoftwair
- Posts: 5446
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Default Artwork if No Other
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...
Re: Default Artwork if No Other
At present if there is missing ID3 metadata I get an error rather than my software displaying nothing
- airsoftsoftwair
- Posts: 5446
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Default Artwork if No Other
Maybe the ID3 recognizer isn't that stable... as I said, that code really implements just a rudimentary parser...