Time Display in Global Rackspace

I like having the Time displayed on when playing live and having read the thread Time Clock I updated the script so that the time can be included in the global rack space rather than in each rack space. The display is only updated every ‘n’ seconds and the format can be set as required. The only issue I had getting this to work is the initialisation of the timer, the rack space must be changed once to get the timer started, but once running stays running.

Add a label widget named lbl_time to the global rack space and add the following lines of code to the global rack space script.

var lbl_time : widget
var int_interval : integer = 1          // Update interval in seconds
var str_format : string = "%H:%M:%S"    // Format of the clock display

// Called by timer ticking
On TimerTick(ns : double)
    var dbl_mSeconds : double
    dbl_mSeconds = ClockTime()
    If (Floor(dbl_mSeconds / 500) % (int_interval << 1)) == 0 Then  
        lbl_time.SetWidgetLabel (FormatTime(dbl_mSeconds, str_format))
    End
End

// Called when rackspace is activated
On Rackspace(oldRs : Integer, newRs : Integer )
    If !GetTimersRunning() Then
        SetTimersRunning(true)
    End
End

There may be a better way but this ticks along nicely

4 Likes

Hi Spav,

Thanks for the script!
I’m new to this…
When I set the script in Global Rackspace I only get “1” displayed in normal mode (not edit mode)

What I’m doing wrong here?

Kind regards,
Martien

I can see that the script only starts the timers going once you change a rackspace. So if you’ve just added the script, you would need to click to a new local rackspace in order to kick it off.

Hello,

I also did, but my clock is not going to start

Kind regards,
Martien

1 Like

Does this gig file work for you?
I also changed it so that the timers start when the script is first intialized (when the gig first loads). So it will start immediately.

Time Display.gig (26.5 KB)

1 Like

Hi Martin,
Welcome.

Did you cut and paste the script in or type it in?
Also are you sure it is in the global rack space and not the global script.?

Let me know if you get it going…

Interesting article… I also might include this in my template rackspace, showing the current time and song time.

You may want to look at the original article if you are planning to use it in a rack space template as opposed to a global rack space template.

1 Like

No i want it in a global rackspace. I shouldn’t have used the word template in my previous comment.

Hi,

What do you mean by “Also are you sure it is in the global rack space and not the global script.?”

Where can I put it in the global rack space?

And I copy and paste it (in the global script) :face_with_raised_eyebrow:

Kind regards,
Martien

Sorry me rushing and not checking, i did get my rack spaces and scripts totally screwed. There is a global script and a global rackspace script, I meant to say “Also are you sure it is in the global rack space script and not the global script.?” Sorry

I really don’t know how to do it.
I only get a “1” in the text box …

Do you mean the gig script and the global rackspace script?

Yep, it’s been a long day and I’m still working!!!

1 Like

I don’t get it to work over here… :cry:
Can you make a small video how it must be done?

Did you try the example gig file I posted above? If it works, you then have a working example to see the widget settings I used, and the global rackspace script.

If you aren’t currently using the global rackspace in your own gig file, you can even export the global rackspace from my example and then import it into your own file.

Yes, I’ve downloaded and installed your file.
No clock is seen…
So it’s nog working
Thanks

Do you have the global panel visible? (Click the bar at the bottom)

image

If you do, can you please post a screenshot of what the panels look like when you open the gig file.


This is what I see

You need to add two rack spaces and switch between them for my script to start the clock.