Loading ...
Sorry, an error occurred while loading the content.
 

Re: [Clip] Re: Play List on RealPlayer

Expand Messages
  • Ray Shapp
    Hi John, Thanks for the reply, but I need a little more than the simplified version. I looked up shell in the NTP Help file and its only reference is to
    Message 1 of 10 , Oct 21, 2002
      Hi John,

      Thanks for the reply, but I need a little more than the simplified version. I
      looked up "shell" in the NTP Help file and its only reference is to UAS.

      I put the following into a new file in NTP>>>
      ^!Shell "C:\My Documents\My Music\Playlist"

      I then double click on the "^!Shell" and the result is a "file not found"
      message.

      My mp3 files are now in the C:\My Documents\My Music\Playlist folder.

      How to you get ^!Shell to execute?

      Ray Shapp
      Using NTP Version 4.91 on a Win98 Pentium box
    • Ray Shapp
      Hi Sheri, Thanks a big bunch for the clip! After I modified it to find the path to my RealPlayer, it ran perfectly. Of course, I now have questions: 1. Why
      Message 2 of 10 , Oct 22, 2002
        Hi Sheri,

        Thanks a big bunch for the clip! After I modified it to find the path to my
        RealPlayer, it ran perfectly.

        Of course, I now have questions:

        1. Why do you have a label called ":End" in the clip? No other line refers
        to it.

        2. When the selection (individual song or the whole folder) is finished
        playing, RealPlayer remains open, but I never see the "Clear the Now Playing
        List?" prompt. How long should I wait to see that prompt? I tried to force
        the prompt to appear by running the clip while RealPlayer was already playing.
        I saw no prompt but your clip did terminate the song in progress and it
        launched into the selected playlist.

        3. I tried to modify the clip to play the selection repeatedly. I added
        "^!Goto Play" immediately prior to the :End label. In another try, I added
        "^!Goto Play" immediately before the final line of the clip. In both
        instances, NTP got into an endless loop and nothing played. I had to close
        NTP to get out of the loop. How does one exit from an endless loop
        gracefully?

        4. Why do you execute the five ^!ClearVariable statements? Is that merely
        good programming practice, or is it a necessary part of the clip's logic?

        5. Where can I read about the "^!Shell" statement?

        Again, thank you for A) supplying a ready-made solution to my original
        question and B) giving me another incentive to learn about clip scripting.

        Ray Shapp
        Watchung, NJ
      • John Zeman
        Hi Ray, I know Sheri has answered most of your questions, but you also asked for more than my simplified response, so here it is.. The reason I kept my last
        Message 3 of 10 , Oct 22, 2002
          Hi Ray,

          I know Sheri has answered most of your questions, but you also asked
          for more than my simplified response, so here it is..

          The reason I kept my last reply simple, is because the concept of how
          I do this might confuse some people. Besides the clip, I use an
          external file that contains the clip parameters. Bear with me, I'll
          try to explain this...

          I have a simple text file here:

          C:\Program Files\Notetab Pro\Libraries\Lists\winamp.txt

          And in that text file are ONLY the names of my winamp playlists which
          are as follows:

          All^=C:\Mine\Files\Home\Winamp\All of it.m3u
          Country^=C:\Mine\Files\Home\Winamp\Country Music.m3u
          Easy Listening^=C:\Mine\Files\Home\Winamp\Easy Listening.m3u
          Oldies^=C:\Mine\Files\Home\Winamp\Oldies.m3u
          Rock^=C:\Mine\Files\Home\Winamp\Rock.m3u

          And then the following clip "reads" the values in that simple text
          file and launches winamp, playing the songs in the playlist I
          selected.

          ^!SetWizardTitle WinAmp Playlist Selector
          ^!SetWizardLabel Make a Selection ya idiot
          ^!Set %x%=^$GetFileText("C:\Program Files\NOTETAB
          PRO\Libraries\Lists\winamp.txt")$
          ^!Set %List%=^$StrReplace("^P";"|";"^%x%";False;False)$
          ^!Set %Play%=^?{(T=L;H=6)=^%List%}
          ^!Shell "^%Play%"

          (Watch for broken long lines in the above clip)

          The reason I like this technique is because it makes changes to the
          playlists, very easy to do.. I just add or delete lines in that
          winamp.txt file..

          John




          --- In ntb-clips@y..., "Ray Shapp" <rayshapp@e...> wrote:
          > Hi Sheri,
          >
          > Thanks a big bunch for the clip! After I modified it to find the
          path to my
          > RealPlayer, it ran perfectly.
          >
          > Of course, I now have questions:
          >
          > 1. Why do you have a label called ":End" in the clip? No other
          line refers
          > to it.
          >
          > 2. When the selection (individual song or the whole folder) is
          finished
          > playing, RealPlayer remains open, but I never see the "Clear the
          Now Playing
          > List?" prompt. How long should I wait to see that prompt? I tried
          to force
          > the prompt to appear by running the clip while RealPlayer was
          already playing.
          > I saw no prompt but your clip did terminate the song in progress
          and it
          > launched into the selected playlist.
          >
          > 3. I tried to modify the clip to play the selection repeatedly. I
          added
          > "^!Goto Play" immediately prior to the :End label. In another try,
          I added
          > "^!Goto Play" immediately before the final line of the clip. In
          both
          > instances, NTP got into an endless loop and nothing played. I had
          to close
          > NTP to get out of the loop. How does one exit from an endless loop
          > gracefully?
          >
          > 4. Why do you execute the five ^!ClearVariable statements? Is
          that merely
          > good programming practice, or is it a necessary part of the clip's
          logic?
          >
          > 5. Where can I read about the "^!Shell" statement?
          >
          > Again, thank you for A) supplying a ready-made solution to my
          original
          > question and B) giving me another incentive to learn about clip
          scripting.
          >
          > Ray Shapp
          > Watchung, NJ
        • Sheri
          Hi Ray, Thank you for your kind remarks. I do encourage you to get involved with Clips, it opens a whole world of possibilities. ... You re right. I intended
          Message 4 of 10 , Oct 22, 2002
            Hi Ray,

            Thank you for your kind remarks. I do encourage you to get
            involved with Clips, it opens a whole world of
            possibilities.

            --- In ntb-clips@y..., "Ray Shapp" <rayshapp@e...> wrote:
            > 1. Why do you have a label called ":End" in the clip? No
            > other line refers to it.

            You're right. I intended to have some ^!IfCancels that would
            go there. I'm working on some enhancements, and will repost
            when ready.

            > 2. When the selection (individual song or the whole folder)
            > is finished playing, RealPlayer remains open, but I never
            > see the "Clear the Now Playing List?" prompt. How long
            > should I wait to see that prompt? I tried to force the
            > prompt to appear by running the clip while RealPlayer was
            > already playing. I saw no prompt but your clip did terminate
            > the song in progress and it launched into the selected
            > playlist.

            I downloaded the RealOne player yesterday, and initially it
            was popping up a prompt by that name. Before it would play a
            different list, I had to select whether the new songs went
            at the bottom of the active list, or replaced the entire
            list. Somehow I disabled the prompt, and now I can't get it
            back. There is an option in Preferences to be Warned when
            the playlist is altered, but when I enable it, it doesn't
            bring back the prompt. All the other players immediately
            replace their active lists when sent a new file (as does
            RealOne once the prompting is disabled).

            > 3. I tried to modify the clip to play the selection
            > repeatedly. I added "^!Goto Play" immediately prior to the
            > :End label. In another try, I added "^!Goto Play"
            > immediately before the final line of the clip. In both
            > instances, NTP got into an endless loop and nothing played.
            > I had to close NTP to get out of the loop. How does one
            > exit from an endless loop gracefully?

            The name of the last file played was not being saved. It
            will be in the enhanced version. I'm also planning to allow
            a playlist to be built from multiple selected files, and to
            add an option to name the playlist and save it to a
            specified Playlist directory. The way it works now, if you
            select the folder option it saves (reuses) a playlist named
            temp.m3u in your document directory. Otherwise it plays a
            selected pre-existing media file (which could be a named m3u
            playlist).

            > 4. Why do you execute the five ^!ClearVariable statements?
            > Is that merely good programming practice, or is it a
            > necessary part of the clip's logic?

            I just like to free up the memory from the variables. If
            you don't do that, the variables are cleared when you change
            Clip libraries or close Notetab.

            > 5. Where can I read about the "^!Shell" statement?

            Under the Help menu, there is "Help on Clip Programming".
            Look in the index under ^!Shell.

            If you are running Notetab Standard or Pro, you should put
            the clip "Clip Help on current word" from the SampleCode
            library up on your clipbar. That will open the ClipCode.chm
            help file to the current command or function.

            If you're running Notetab Light, you could copy the clip
            from the SampleCode library into your copy of the
            Cliphelp.clh file and access it from the Clip Assistant.
            The Clip Assistant is a special clipbook that runs in the
            Quick List (see the Tools menu), and its clips work on clip
            code.

            > Again, thank you for A) supplying a ready-made solution to
            > my original question and B) giving me another incentive to
            > learn about clip scripting.

            My pleasure :)

            Regards,
            Sheri
          • Sheri
            ... You can press Ctrl+Alt to halt a runaway clip :) Now that I read more carefully what you did with the ^!Goto Play, I think the reason it didn t work was,
            Message 5 of 10 , Oct 22, 2002
              Missed one:

              --- In ntb-clips@y..., "Ray Shapp" <rayshapp@e...> wrote:
              > How does one exit from an endless loop gracefully?

              You can press Ctrl+Alt to halt a runaway clip :)

              Now that I read more carefully what you did with the ^!Goto Play, I
              think the reason it didn't work was, before the player had a chance
              to play the song, it kept getting clobbering with new input.

              Regards,
              Sheri
            • Ray Shapp
              Thanks John and Sheri for all the help. Thanks especially for the Get-Out-Of-Jail-Free card ( Ctrl+Alt ). I expect I ll need that quite often as I try to
              Message 6 of 10 , Oct 22, 2002
                Thanks John and Sheri for all the help. Thanks especially for the
                Get-Out-Of-Jail-Free card ( Ctrl+Alt ). I expect I'll need that quite often
                as I try to customize your clip.

                >>>I think the reason it (what you did with the ^!Goto Play) didn't work was,
                before the player had a chance to play the song, it kept getting clobbering
                with new input.<<<<<

                I was wondering how you were pausing the clip exactly long enough for each
                selection to finish playing. If I understand correctly, you didn't pause the
                clip. Instead you were able to send a complete stack of titles to a temporary
                file, and then you sent that file to RealPlayer. RP then played the tunes in
                succession. Is that right? If so, one way to simulate repeat play would be
                to make many copies of the stack before sending the stack on to RP. This idea
                worked when I merely duplicated your original line 16 (^!InsertText ^%Files%).
                Can you suggest a better alternative?

                Thanks again,

                Ray Shapp
                Watchung, NJ
              • Sheri
                Hi Ray, ... Yes, exactly. I am only sending one file to the player, and it is either a temporary m3u playlist I construct or a single selected media file. ...
                Message 7 of 10 , Oct 22, 2002
                  Hi Ray,

                  --- In ntb-clips@y..., "Ray Shapp" <rayshapp@e...> wrote:
                  > I was wondering how you were pausing the clip exactly long
                  > enough for each selection to finish playing. If I
                  > understand correctly, you didn't pause the clip. Instead
                  > you were able to send a complete stack of titles to a
                  > temporary file, and then you sent that file to RealPlayer.
                  > RP then played the tunes in succession. Is that right?

                  Yes, exactly. I am only sending one file to the player,
                  and it is either a temporary m3u playlist I construct or a
                  single selected media file.

                  > If so, one way to simulate repeat play would be
                  > to make many copies of the stack before sending the stack
                  > on to RP.

                  Yes, if you know you will want to repeat the same track(s)
                  you can put them in a playlist multiple times.

                  You could make a clip wizard to prompt for the number of
                  times to repeat. Put a label above the ^!InsertText code,
                  and a ^!Goto ThatLabel under it. Just above the ^!Goto, keep
                  a counter (using ^!Inc) of how many repeats have been
                  inserted. Then test the counter with an ^!If command, e.g.,

                  ^!If ^%RepeatCounter%=^%RepeatRequested% ^!Goto NextLabel

                  In this way, the ^!InsertText command would be repeated
                  until the right number of copies is in the playlist.

                  To do it with a single file instead of a whole folder, you
                  would have modify the clip to write out an m3u playlist for a
                  single file.

                  If you just want to repeat the last file after it has
                  finished playing or on a subsequent run of the clip (even
                  after closing and reopening Notetab), you can save and
                  retrieve the name of the last file in an ini file and add
                  a Repeat Play to the initial menu/wizard. That's what I'll
                  be doing my enhanced version. The menu will also show the
                  name of the last file.

                  Regards,
                  Sheri
                • h.paulissen@facburfdcw.unimaas.nl
                  Ray, Sheri, I m not familiar with RealPlayer, but it would surprise me if it didn t have a loop function (repeat built into Real) ... Hugo
                  Message 8 of 10 , Oct 23, 2002
                    Ray, Sheri,

                    I'm not familiar with RealPlayer, but it would surprise me if it didn't have
                    a loop function (repeat built into Real)

                    >
                    > > If so, one way to simulate repeat play would be
                    > > to make many copies of the stack before sending the stack
                    > > on to RP.
                    >
                    > Yes, if you know you will want to repeat the same track(s)
                    > you can put them in a playlist multiple times.
                    >

                    Hugo
                  • Ray Shapp
                    Hi Hugo, The Pro version of RealPlayer does have a repeat function and other useful features. It also is more wasteful of resources (download time). Besides,
                    Message 9 of 10 , Oct 23, 2002
                      Hi Hugo,

                      The Pro version of RealPlayer does have a repeat function and other useful
                      features. It also is more wasteful of resources (download time). Besides,
                      I'm using Sheri's clip as an introduction and incentive to get into clipping.
                      That's the reason for my very basic questions in previous posts.

                      Thanks for your suggestion.

                      Ray Shapp
                      Watchung, NJ
                    • hugo_paulissen
                      ... clipping. ... And I didn t want to take anything away from that... I learned a lot in getting answers and examples from the list, and once you ve got the
                      Message 10 of 10 , Oct 23, 2002
                        > I'm using Sheri's clip as an introduction and incentive to get into
                        clipping.
                        > That's the reason for my very basic questions in previous posts.
                        >

                        And I didn't want to take anything away from that... I learned a lot
                        in getting answers and examples from the list, and once you've got
                        the hack of it you're off.

                        Hugo
                      Your message has been successfully submitted and would be delivered to recipients shortly.