Due to enormous amounts of spam, the forum has been set to read-only mode.



Reply to topic  [ 47 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
One for the XML pundits - playing a symphony 
Author Message
User avatar

Joined: Wed Oct 01, 2003 6:09 pm
Posts: 1142
Location: Location: Location:
Post Re: One for the XML pundits - playing a symphony

Right, here we are again, getting on for 12 hours later.

@Les (and any others tempted)
I've attached my copy of Album_Tracks.xsl with the additional section clearly commented.
As I mentioned, I also made the additional entries in style.css
Rather than attach that whole file (which has lots of other uncommented modifications) here is the block of definitions I added. I don't think location is critical in the style.css file
Code:
.worktable {
  border-style: solid;
  border-spacing: 1px;
  border-width: 1px 1px 1px 1px;
  border-collapse: collapse;
}
.workrow {
  vertical-align : top;      
}
.workname{
  width: 30px;
  background-color: #69738C;
  color :White; 
  font-weight: bold;
  padding-left: 4px;
  padding-right: 4px;
  vertical-align: top;
  text-align=left;
}
.workvalue{
  width:512px;
  background-color: White;   
  text-align: left; 
  border-style: solid;
  border-color: #d8d8d8;
  border-width: 1px 1px 1px 1px;
}
.workplay{
  width:43px;
  background-color: White;   
  padding-left: 4px;
  padding-right: 4px;
  vertical-align: top;
  text-align: right; 
  border-style: solid;
  border-color: #d8d8d8;
  border-width: 1px 1px 1px 1px;
}
Colours, sizes etc are all a matter of personal preference. Either adjust these to suit, or remove the CLASS statements in the .xsl file, or use some of Fredrik's standard definitions such as .tablerecordsrow, .tablerecordscell as appropriate in your .xsl code.

@Litago
I've now tried adding the same code to my AlbumTrack.xsl as an experiment. The fields display but, as you say, the SUM function in this case returns a value of 00:00 for all entries. I'm just poking around now trying to spot any significant differences. I think I might just decide this was outside the scope of the original project definition and charge myself a penalty for altering the user requirements specification after the implementation had begun. I'm in negotiations about the fee at present - should it be one large glass of wine or two? :wink:

Ken


You do not have the required permissions to view the files attached to this post.


Wed Jul 06, 2011 9:11 pm
Profile

Joined: Wed Sep 18, 2002 1:53 am
Posts: 462
Location: North Wales, UK
Post Re: One for the XML pundits - playing a symphony

KAM wrote:
@Les (and any others tempted)
I've attached my copy of Album_Tracks.xsl with the additional section clearly commented.
As I mentioned, I also made the additional entries in style.css
Ken

Hi Ken,

This is a great enhancement, thanks for posting the complete .xsl file (I was having difficulty incorporating the chunks of code that you and Litago posted previously). This works really well.

Now I just have to populate the rest of the custom05 fields and tick the start of each work in my classical collection...I don't suppose you have a magic wand you could post?

cheers, Les


Thu Jul 07, 2011 8:25 am
Profile WWW
User avatar

Joined: Wed Oct 01, 2003 6:09 pm
Posts: 1142
Location: Location: Location:
Post Re: One for the XML pundits - playing a symphony

Les

Glad you like it. The more I use it the more I'm amazed I didn't think of extending things in this direction much earlier.

However I'd be the first to admit that everything I've done has just been formatting & layout. The beating heart of the code is the PLAYFILTER and SUM functions that Fredrik supplied. The rest is just cosmetic.
(Hey, I'll maybe take a little credit along the lines of "based on an original idea by ..." :wink: )

As for populating the two custom data fields I don't know of any oofle dust we can sprinkle on this problem. I've just got in to the habit of filling the start-of-work track with everything I can get on it (Opus No., Work name, Catalogue, Key, Date written etc) and then using the track template facility to copy to the other relevant tracks on the album. It should be possible to do this across albums using the Copy Track Data but my work methods had settled in to their existing patterns some time ago. There was related thread back in January here where I did some other free-thinking on the idea of a master record for every given work in a collection. I haven't followed that path myself - it was all just good conceptual stuff. I'm an ideas man - this thread is one of my rare forays in to implementation territory!

In addition to the new xsl display I've also started using a two-level grouping in the Track View: Composer and Work. I've applied a composite filter in the group so that only 'classical' tracks are shown, and only Start of Work entries are shown. So I can browse quickly to Beethoven, then to his Piano Concerto No.5, and only three tracks are displayed. These correspond to the start of the Arrau, Gilels and Serkin recordings I have. Next task for this evening is to follow Litago's idea and try to add the Work code to the TrackBrowse.xls That way I could queue up and play the entire work from there. I have to admit I'm approaching this more in hope than expectation, so no doubt I'll be back again asking for guidance!

Regards

Ken


Thu Jul 07, 2011 9:43 am
Profile

Joined: Wed Sep 18, 2002 1:53 am
Posts: 462
Location: North Wales, UK
Post Re: One for the XML pundits - playing a symphony

KAM wrote:
In addition to the new xsl display I've also started using a two-level grouping in the Track View: Composer and Work. I've applied a composite filter in the group so that only 'classical' tracks are shown, and only Start of Work entries are shown.

Hi Ken,
I use a similar system, but mine works by exception. That is the work title in only input once in the custom field (at the start of the work) and the work filter is set to "is NOT equal to BLANK".

I made a small tweak to the code you posted to replace the word "play" with the play icon
Code:
<IMG SRC="Play.gif" BORDER="0"/>


Now I have another question (sorry!)...
In the example below I have an album that features two works by different composers. Is there a way to modify the code such that work summary at the top shows:
Arensky: Piano Trio In D Minor, Op.32
Tchaikovsky: Piano Trio In A Minor, Op.50

Just a thought.

Cheers, Les


You do not have the required permissions to view the files attached to this post.


Thu Jul 07, 2011 10:10 am
Profile WWW
User avatar

Joined: Wed Oct 01, 2003 6:09 pm
Posts: 1142
Location: Location: Location:
Post Re: One for the XML pundits - playing a symphony

Les

(1)
In retrospect your method of only having the work name entered once does seem simpler to manage. However when I started down this twisted path many years ago I wasn't sure whether I'd encounter entries like an "Adagio ma non troppo" and then have no immediate indication of what it belonged to. As it happens, because of the way I name tracks themselves, I don't think this will ever happen. At the time I also thought that recording a positive entry for every work was a clearer indication of missing data compared to unnecessary data i.e. if a field was blank, was it meant to be blank or was I overdue in updating it?
I'd also experimented in the past with another pair of custom fields - section, and start of section. I think I intended these to be used with, say, opera recordings. The work would be the opera name, the sections would be the individual acts, and each track would be an aria, overture etc as appropriate within an act. I've really not pursued this for a couple of years and much of the work there is now a fossil thanks to changes I've made elsewhere. (Note to self: tidy this up at soonest opportunity.)

(2)
I did use a play symbol to begin with, but I wanted something different to designate playing the whole work. I started designing and editing another symbol, but used the word "Play" as a functioning placeholder as an interim measure. Then I grew to like it. I may change, but probably not.

(3)
Ah, attaching composers' names to the works! I haven't found anywhere in the database that I record only the surname of a composer so there didn't seem to be any obvious place to link that to. I mentioned earlier the problem with the Grieg and Schumann piano concertos on one disc: both are Piano Concertos in A Minor. I did try just adding GRIEG: or SCHUMANN: as a prefix to the work name, but the thought of doing that for all the entries scared me. I've backed off from this problem to have a think about it at present. Let me know if you have any breakthrough ideas.

Regards

Ken


Thu Jul 07, 2011 2:07 pm
Profile

Joined: Wed Sep 18, 2002 1:53 am
Posts: 462
Location: North Wales, UK
Post Re: One for the XML pundits - playing a symphony

Hi again Ken,
KAM wrote:
(2) I did use a play symbol to begin with, but I wanted something different to designate playing the whole work.

I thought you might have. I had the same feeling and have now found a suitably different speaker .gif on the web.

KAM wrote:
(3) Ah, attaching composers' names to the works! I haven't found anywhere in the database that I record only the surname of a composer so there didn't seem to be any obvious place to link that to.

I keep my classical database separate from the rest of my stuff, so I actually use the "Artist" field for the name of the composer. So what I'd really like to do with the .xsl file is include that field in front of the work-name. Does this make the task any more do-able? Please see faked screenshot of what I'm after...

Regards, Les


You do not have the required permissions to view the files attached to this post.


Thu Jul 07, 2011 5:06 pm
Profile WWW
User avatar

Joined: Wed Oct 01, 2003 6:09 pm
Posts: 1142
Location: Location: Location:
Post Re: One for the XML pundits - playing a symphony

Les

This goes against all my principles, you know! Helping someone who uses the Artist field for the Composer! I don't know how I can live with myself after this. I'm going to suffer all sorts of mental anguish and PTFE or whatever it is.

Anyway, after knocking the code about a bit the neatest I can arrive at is to insert the bold code where shown -
Quote:
<TD CLASS="workname" >
<xsl:value-of select="/data/fld/track/custom05/@name"/>
</TD>
<TD CLASS="workvalue">
<xsl:call-template name="format-artist">
<xsl:with-param name="artists" select="artists"/>
</xsl:call-template>
</TD>

<TD CLASS="workvalue">
<A HREF="TrackList.xsl?Custom05={custom05}@xslparam:doctitle={/data/fld/track/custom05/@name}:{custom05}">
<xsl:value-of select="custom05"/>
</A>
</TD>

I haven't been able to test this exhaustively, as strangely enough I put Artists in the Artist field. Now who would have guessed that? :wink:
However it does seem to pick up my Artists and stick them in the right place.

The other thing to be aware of here is that I've just used <TD CLASS="workvalue"> for convenience in that piece of code. Aesthetically it doesn't look too good on my setup - the cell is much too wide. I suggest you may want to define a new style (in style.css) to format this, or else, as Litago showed in his code, just declare all the size, shape, colour characteristics etc right in the TD statement itself. As ever, horses for courses.

Good luck

Ken


Thu Jul 07, 2011 11:10 pm
Profile

Joined: Wed Sep 18, 2002 1:53 am
Posts: 462
Location: North Wales, UK
Post Re: One for the XML pundits - playing a symphony

Hi Ken,

KAM wrote:
This goes against all my principles, you know! Helping someone who uses the Artist field for the Composer!

I know, I know!
I guess I have the "record shop" mentality when it comes to cataloguing my collection...that is if you want to find Led Zeppelin, look under "L", if you want to find Beethoven look under "B" (not "R"attle or "V"ienna Philharmonic etc.). I use separate fields in the "People" tab to list Orchestras/Ensembles, Conductors and Soloists so I can still sort and explore my collection in any of these ways.

KAM wrote:
Anyway, after knocking the code about a bit the neatest I can arrive at is to insert the bold code where shown ... I haven't been able to test this exhaustively, as strangely enough I put Artists in the Artist field.

Ken, it works like a dream (even for composers :) )

KAM wrote:
The other thing to be aware of here is that I've just used <TD CLASS="workvalue"> for convenience in that piece of code. Aesthetically it doesn't look too good on my setup - the cell is much too wide. I suggest you may want to define a new style (in style.css) to format this

Thanks for the explanation. That's exactly what I have done (you'll, no doubt, be pleased to hear that I named the additional style "workartist" - ha!ha! :lol:)

Anyhow, after adjusting the field widths the final result is exactly as the "fake" image I posted earlier.

So, thanks again. Your help (and humour) are much appreciated

- Les

-- update --
I did a few final tweaks to the vertical alignment and padding in the stylesheet, so I thought I'd post one final screenshot (below)


You do not have the required permissions to view the files attached to this post.


Fri Jul 08, 2011 10:37 am
Profile WWW
User avatar

Joined: Wed Oct 01, 2003 6:09 pm
Posts: 1142
Location: Location: Location:
Post Re: One for the XML pundits - playing a symphony

Brilliant - I'm glad it's all worked out so well. :grin:
This whole thread has grown way beyond what I expected when I submitted the original post. All we need to do now is generate a sufficiently strong groundswell of opinion to get Fredrik to include something like this (but done properly!) in standard releases in future.

Ken

(Because of the different ways we record information, I keep looking at the top line page header on your screenshot and seeing this as a performing duo called Brahms & Bruch (like Simon & Garfunkel or Crosby & Nash) who've got together for a series of recordings of their own solo career works. Cor, wouldn't that be great! Role on time-travel - it can't come soon enough. :grin:

[Hmmm... actually, now that I think about that, it shouldn't matter when time travel is invented because as soon as it is, wouldn't it then be available throughout all space-time, forwards and backwards. So, does the fact that we don't have it now mean that no-one in the future will ever invent it either? :? :( :?
Oh, I wish I'd never started this ...]
)


Fri Jul 08, 2011 12:37 pm
Profile
User avatar

Joined: Wed Oct 01, 2003 6:09 pm
Posts: 1142
Location: Location: Location:
Post Re: One for the XML pundits - playing a symphony

Litago

I've been working at the equivalent entry in TrackBrowse.xsl and other templates but, like you, I can't get the total work time displayed using SUM. I think you'll have to rely on greater minds than mine on this aspect I'm afraid. :(

The only addition I've now done to my own TrackBrowse.xls is
Code:
<!-- Work -->
         <TR CLASS="fieldrowprevpane">
            <TD CLASS="fieldnameprevpane" NOWRAP="">
               <xsl:value-of select="/data/fld/track/custom05/@name"/>         
            </TD>
            <TD CLASS="fieldvalueprevpane" WIDTH="100%">
               <A HREF="TrackList.xsl?Custom05={custom05}@xslparam:doctitle={/data/fld/track/custom05/@name}:{custom05}">
               <xsl:value-of select="custom05"/>
               </A>
               <A HREF="PLAYFILTER:Track.Custom05={custom05}@Track.AlbumID={albumid/@unformatted}@orderby=Track.Position@validate=yes,1">
                  <IMG SRC="Play_work.gif" BORDER="0" />
               </A>
            </TD>   
         </TR>
My existing TrackBrowse is quite thoroughly modified so recommending an insertion point is not easy. It belongs in the second <xsl:template> section at a point that makes sense to the rest of your display.
I edited the play_work.gif and I've attached it here. If you want to use this, copy it to your Explorer Templates folder.
Attachment:
Play_work.gif


Good luck and sorry I couldn't finish the job,

Ken


You do not have the required permissions to view the files attached to this post.


Fri Jul 08, 2011 9:44 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 47 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.