Relative file path

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Leff
Posts: 26
Joined: Sun Sep 21, 2014 12:44 pm

Re: Relative file path

Post by Leff » Mon Oct 06, 2014 2:50 pm

Leff wrote:Sorry, don't understand?
Do you mean the filename is only saved with the stack in that case?
That would be correct, LC cannot read our minds (yet) :D
Hehe :-) To bad :-)

One of my test apps is designed like this: A pulldown menu that displayes different tutorials (improvisation, image area and a player).
The code of the pulldown menu is:

on menuPick pItemName
switch pItemName
case "HardRock"
set filename of player "Player" to "./Audio/Aminor/HardRockAminor.m4a"
set filename of image "neck" to "./Images/Aminor/AbluesScalePos1.png"
break
case "Jazz"
set filename of player "Player" to "./Audio/Aminor/SlowFunkJazzAminor.mp3"
set filename of image "neck" to "./Images/Aminor/AbluesScalePos2.png"
break
end switch
end menuPick

(The scales and backingtrack is just there for me learning LC. Offcourse you can use A-blues scale pos 1 and 2 and 3 and 4 and 5... on both a-minor tracks :-) )

As you se the player is loaded with music and the Image Area "neck" is displaying the correct .png. But... LC only export (for the standalone app) the image and audio file that is loaded on the main stack. How come? To clarify... If I select "Jazz" LC is only exporting the current files to the standalone app. If I selct "HardRock" it just export the active files.

This is, by the way, not how I am going to make the app. This is only for learning.

Is there a media-player plugin that don't require the user to install any extra software? Will do some work today about populating fields with info from my subfolders. Would it not be better to use a database (card) that takes controll of all the files that I need to display. I would really like, when making the actual tutorials, to be able to just put my lessons/tutorials (improv...) in a database with the desired parameters and woila!, the database prg move the files to the correct folders. So my idea is just to use a main stac that just display the content of my tutorial. Many others ideas to, but I hope to be able to do this within a year or so.

(puh... hope you understand me. As you see English is not my native language) Thank all of you who are answering and helping me! :-)

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10053
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Relative file path

Post by FourthWorld » Mon Oct 06, 2014 5:28 pm

newtronsols wrote:So I'd imagine 6.7 was everything 6.6 plus a bit more. But I read the forum 'suggest' that e.g. 6.x commercial isn't 6.x community or that 7 [potentially/ I don't know] could be stable 6.5 'forked off' to 7. I only suggest this as 7 exports to 6.5 - not a later build.
It may be useful to know where that forum "suggest" was so I can try to figure out where the confusion originated.

Like many open source projects, thanks to the major code refactoring and the wonders of GitHub, the team is currently working on three versions of LiveCode.

The current shipping version is 6.6.3.

If you have time an interest to help test, then 6.6.4, 6.7, and 7.0 are available for testing, each currently in "RC" ("Release Candidate") status:
http://downloads.livecode.com/livecode/

6.6.4 is a minor update to the current shipping version to address issues Apple introduced with iOS 8.

6.7's focus is a major ovverhaul of LiveCode's interface to OS X, transitioning from the older Carbon libs to Cocoa.

7.0's focus is Unicode, though the last several versions have included all fixes and enhancements from v6.7.

If you need to deliver production apps immediately, as with any app you're probably best using the latest release version rather than a pre-release version.

If you find any issues in any build, please file a bug report.

While file format changes in LiveCode are rare, the engine always supports saving to at least the last available format, often more. With v7, Save As supports the last three formats, ensuring compatibility with all shipping versions going back nearly a decade.

Of course as with any app, features dependent on the newer format will be lost if saved in an older format.

Regression errors are a risk with all software. To mitigate these risks RunRev has an extensive and growing collection of automated testing tools, to compliment the work we in the community do to test each version to ensure it supports the unique requirements of our work.

What specific regression issues have you encountered among shipping versions? And for test versions, what are the bug report numbers for the issues you found, so we can help confirm and track them?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Klaus
Posts: 14205
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Relative file path

Post by Klaus » Mon Oct 06, 2014 9:28 pm

Hi Leff,
Leff wrote:...
(The scales and backingtrack is just there for me learning LC. Offcourse you can use A-blues scale pos 1 and 2 and 3 and 4 and 5... on both a-minor tracks :-)
Ah, a musician, love it! :D
Check this if you like: http://www.major-k.de/bass
Leff wrote:As you se the player is loaded with music and the Image Area "neck" is displaying the correct .png. But... LC only export (for the standalone app) the image and audio file that is loaded on the main stack. How come? To clarify... If I select "Jazz" LC is only exporting the current files to the standalone app. If I selct "HardRock" it just export the active files.
I think you checked "Copy referenced files" on the "Copy files" card of the standalone builder, right?

DON'T! :D

This way ONLY the ONE sound and ONE image that are currently selected/displayed as you describe above, will be copied!

Just add your media folders "Audio" and "Images" via the "Copy folder..." button!
That's all you need, LC will put these folders including content into the standalone at the right place, so your "menupick" handler
will still work on Mac and Windows!

Hint: Set the filenames of your "dynamic" player and image objects to EMPTY before you build the standalone, at least loading audio
(and video) will slow down starting up the stack a bit.
Leff wrote:Is there a media-player plugin that don't require the user to install any extra software?
No, unfortunately not. LC requires QuickTime to be installed also on a Windows PC.
If you "set the dontuseqt to true" on preopenstack on windows, then QT is NOT loaded and you might be able to play SOME audio and video files
(not sure which ones) in a player object, but since the CONTROLLER is a QT only feature!, this will not be much fun, since you need to create
your own and not all PLAYER properties are supported without QT!

Hope that helps!


Best

Klaus

Leff
Posts: 26
Joined: Sun Sep 21, 2014 12:44 pm

Re: Relative file path

Post by Leff » Mon Oct 06, 2014 9:50 pm

Hi Klaus,
Klaus wrote:Ah, a musician, love it! :D
Check this if you like: http://www.major-k.de/bass
...and thats why I will make my own app the way I like to teach :-) And off course learning new things. Back in 2008 I bought 2 big books with Objective-C (xcode) Started but did not find the time to learn it. Would also like to learn Swift, but (even though it's supposed to be easyer... than objective-c) to much to think about. So maybe LC could be the thing for me.

Musician you to :-) Will check out your webpage!
Klaus wrote:I think you checked "Copy referenced files" on the "Copy files" card of the standalone builder, right?

DON'T! :D
Thank you! Thats what I did wrong... Now I know why the files was gone :-) Will set the filenames empty as you suggested. This is usefull information! Nice!

I also found out today how to "glue" objects to the mainstack and also keeping the relative placement between objects. Fun!

Leff
Posts: 26
Joined: Sun Sep 21, 2014 12:44 pm

Re: Relative file path

Post by Leff » Wed Oct 08, 2014 8:23 am

New queston ;-)

I am googling and looking at tutorials, but have not find an answer yet. I have made custom buttons for the player (player set to invisible. just music for now). The stop,play, pause and ff/rw is ok, but I can't find info on controlling the player slider with a custom slider (the slider in the tools menu). The "stop" is stopping the music, but it dont set it back to start when pressing "play". The play is just as a pause button after clicking stop. I am just going to use play/pause as one button (need info on how to set different icon when play symol is pressed, have tried many things...) and I am going to use "stop" as compleatly stop (setting music/video back to start). For now I need the info on controlling the slider so that the user can use that instead of FF/RW (like youtube). I would also like to know how to use loop function on the slider (if it's possible) so that my students can loop selected area in the slider (for practise difficult stuff over and over again until pressed stop/pause/start for unlooping). The last thing here is not urgent.

To sum up... How to controll the slider in player with custom slider. If I should guess the player need to give customSlider info of duration and continual percentages from 1 to 100 (the length of the track). The slider need to give the player info when interacted and to where it is set from 1 to 100. If loop it needs to know where to loop e.g. from 30 to 50. It would also need to make graphics controller for loop area in the slider... Ohh... This might be over the top for me now or maybe I am thinking all wrong :)

So if you kind people would helpe me once more, I would be very happy! I will try to figure out for my selfe too.

This is so fun! Wow, it's like making music! :-)

Leff
Posts: 26
Joined: Sun Sep 21, 2014 12:44 pm

Re: Relative file path

Post by Leff » Thu Oct 09, 2014 11:12 pm

Can I use the scrollbar (slider) to control the audio/video starting points? Like in the Player but with a custom design? Found the script to the play, pause and all that but not how to control the progressbar in Player. Is it possible?

Post Reply