Skip to content

Commit

Permalink
UltraKiss 3.5.2 update 1
Browse files Browse the repository at this point in the history
  • Loading branch information
William authored and William committed Jun 3, 2023
1 parent 6cff794 commit a1bb74f
Show file tree
Hide file tree
Showing 18 changed files with 166 additions and 85 deletions.
Binary file not shown.
16 changes: 16 additions & 0 deletions src/Demo/FKiSS Tests.Action Tests.html
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,22 @@ <h1 align="center"><font color="#800000">FKiSS Action Tests</font></h1>
<td colspan="10">Demonstrates message dialog boxes and other controls.</td>
</tr>
<tr>
<td align="center" rowspan="2"><img border"0" src="Images/FKiSS Tests.Action Tests/mediaplayer.jpg" width="50" height="50"></td>
<td align="center"><a href="Data/FKiSS Tests.Action Tests/mediaplayer.zip">mediaplayer.zip</td>
<td align="center">31 KB</td>
<td align="center">0</td>
<td align="center">0</td>
<td align="center">0</td>
<td align="center">0</td>
<td align="center">0</td>
<td align="center">5</td>
<td align="center">Yes</td>
<td align="center">Yes</td>
</tr>
<tr>
<td colspan="10">Demonstrates MediaPlayer playlist control.</td>
</tr>
<tr>
<td align="center" rowspan="2"><img border"0" src="Images/FKiSS Tests.Action Tests/modal.gif" width="50" height="50"></td>
<td align="center"><a href="Data/FKiSS Tests.Action Tests/modal.zip">modal.zip</td>
<td align="center">31 KB</td>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 6 additions & 3 deletions src/Help/product/reference2/mediaplayer.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
<body>

<h4><a name="mediaplayer" id="mediaplayer">mediaplayer</a>()</h4>
<p><b><font color="#FF0000">Syntax:</font></b>&nbsp;&nbsp;&nbsp;&nbsp; mediaplayer (filename[,repeat])<br>
<p><b><font color="#FF0000">Syntax:</font></b>&nbsp;&nbsp;&nbsp;&nbsp; mediaplayer (filename[,repeat[,minimized[,x,y]]])<br>
<br>
The mediaplayer() command integrates with the UltraKiss Media Player tool used for playback and control of background audio files. The media player is also the preferred method to control display and playback of video files associated with a KiSS set. </p>
<p>For background audio the media player can automatically suspend itself and resume playback if the KiSS set initiates a music() or sound() file. This behaviour is controlled by UltraKiss media options. </p>
<p>Only one mediaplayer() command can be concurrently active. A mediaplayer(&quot;&quot;) command with an empty filename will terminate all currently playing media files.</p>
<p>For background audio the media player can automatically suspend itself and resume playback if the KiSS set initiates a music() or sound() file. This behaviour is controlled by UltraKiss media options. </p>
<p>Only one mediaplayer() command can be concurrently active. A mediaplayer(&quot;&quot;) command with an empty filename will terminate all currently playing media files.</p>
<p>The optional <em>repeat</em> parameter is an integer repeat count for playback of the file. A negative repeat count results in continuous looping of the media file. </p>
<p>The optional <em>minimized</em> parameter, if non-zero, hides or minimizes the mediaplayer on invocation. This is the default state. To show the mediaplayer a zero value must be specified for this parameter. </p>
<p>The optional <em>x and y</em> parameters specify the location for the mediaplayer. The default state will center the mediaplayer in the playfield. </p>
<p>Sound files, movie files, or media player playlists can be specified. UltraKiss will accept WAV, AU, RMF, AIFF, MP3, and AVI file encodings for the mediaplayer() command. UltraKiss will also process playback lists which contain entries for many media files. A playlist which is a text file with a &quot;<font face="Courier New, Courier, mono">.lst</font>&quot; or &quot;<font face="Courier New, Courier, mono">.m3u</font>&quot; extension. A playlist contains one line with the path name of each file to be played, as shown below. Note that in this case the media file locations are relative to the same directory that contains the playlist file. </p>
<p><font face="Courier New, Courier, mono">Era.mp3<br>
Ameno (remix).mp3<br>
Expand All @@ -32,6 +34,7 @@ <h4><a name="mediaplayer" id="mediaplayer">mediaplayer</a>()</h4>
<p>If the specified file does not exist then the command fails silently. </p>
<p>A mediaplayer() command is independent from a music() command and a sound() command. </p>
<p>The FKiSS5 mediastart() and mediastop() events can also be used to control playback. These events fire on sound initiation and sound termination for the specified mediaplayer file. </p>
<p>If the mediaplayer file is a playlist then the FKiSS5 mediastart() and mediastop() events fire on sound initiation and sound termination for the playlist. </p>
<p>&nbsp;</p>
<p>Related events: <a href="mediastart.html">mediastart(),</a> <a href="mediastop.html">mediastop()</a> <br>
Related actions: <a href="sound.html">sound(),</a> <a href="music.html">music()</a> <br>
Expand Down
6 changes: 3 additions & 3 deletions src/Help/product/reference2/music.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ <h4><a name="music" id="music">music</a>()</h4>
<p>If the filename does not exist then the music() command fails silently. </p>
<p>A music() command is independent from a sound() command. </p>
<p>&nbsp;</p>
<p><font color="#FF0000"><b>FKiSS 5 Syntax:</b></font>&nbsp;&nbsp;&nbsp;&nbsp; sound (filename[,repeat])</p>
<p><font color="#FF0000"><b>FKiSS 5 Syntax:</b></font>&nbsp;&nbsp;&nbsp;&nbsp; music (filename[,repeat])</p>
<p>FKiSS 5 introduced an optional <em>repeat</em> parameter for audio playback. This parameter specifies the number of times that the sound is to be repeated. Note that the repeat value specifies the number of sound repetitions, thus a value of 1 repeats the sound once, resulting in the original playback being heard plus one repetition of the sound. A negative repeat value will result in the sound being repeated indefinately.</p>
<p>FKiSS provided no easy way to control or manage sound playback. There was no way to determine when a sound file terminated such that it could be repeated. </p>
<p>The FKiSS5 mediastart() and mediastop() events can be used to recognize sound playback events. These events fire on sound initiation and sound termination for the specified sound file. These events fire on completion of the command and not on completion of the sound. Thus, if repetition was specified, one mediastart event fires at the beginning of the command and one mediastop event fires when all repetitions are complete. </p>
Expand All @@ -34,13 +34,13 @@ <h4><a name="music" id="music">music</a>()</h4>
<table border="1" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="26%">FKiSS 1 requires literal filenames.</td>
<td width="24%">sound(&quot;happysound.wav&quot;)</td>
<td width="24%">music(&quot;happysound.wav&quot;)</td>
<td width="50%"></td>
</tr>
<tr>
<td width="26%">FKiSS 5 allows string variables </td>
<td width="24%">let(S,&quot;happysound.wav&quot;)<br>
sound(S)</td>
music(S)</td>
<td>&nbsp;</td>
</tr>
</table>
Expand Down
8 changes: 7 additions & 1 deletion src/Help/product/reference2/viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@ <h4> Viewer Functions</h4>
menu function.</td>
</tr>
<tr>
<td>&quot;option&quot;</td>
<td>&quot;getoption&quot;</td>
<td>This gets the value of an UltraKiss viewer options.&nbsp; The argument arg1 is the option
name and arg 2 is a variable for the returned value. Option names are shown below.&nbsp;&nbsp;
</td>
</tr>
<tr>
<td>&quot;setoption&quot;</td>
<td>This sets or clears UltraKiss viewer options.&nbsp; The argument arg1 is the option
name and arg 2 is the required value. Option names are shown below.&nbsp;&nbsp;
</td>
Expand Down
12 changes: 6 additions & 6 deletions src/Kisekae/EventHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ final class EventHandler extends KissObject
0,0,76,76,0,0,12,12,12,12,12,12,0,0,0,0,0,0,0,0,0,39,39,0,0,0,0,0,0,0,0,
5,5,20,0,20,0,0,28,12,0,12,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,
0,0,0,0,12,
0,0,0,0,
0,0,0,0,20,20,
12,12,
Expand All @@ -477,7 +477,7 @@ final class EventHandler extends KissObject
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,20,0,0,28,12,0,12,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,
0,0,0,0,12,
0,0,0,0,
0,0,0,0,0,20,
0,0,
Expand Down Expand Up @@ -537,7 +537,7 @@ final class EventHandler extends KissObject
0,0,76,76,0,0,12,12,12,12,12,12,0,0,0,0,0,0,0,0,0,39,39,0,0,0,0,0,0,0,0,
5,5,20,0,20,0,0,28,12,0,12,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,
0,0,0,0,12,
0,0,0,0,
0,0,0,0,20,20,
12,12,
Expand All @@ -554,7 +554,7 @@ final class EventHandler extends KissObject
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,20,0,0,28,12,0,12,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,
0,0,0,0,12,
0,0,0,0,
0,0,0,0,0,20,
0,0,
Expand Down Expand Up @@ -616,7 +616,7 @@ final class EventHandler extends KissObject
28,28,76,76,0,0,12,12,12,12,12,12,0,0,0,0,0,0,0,0,0,39,39,0,0,0,0,0,0,0,0,
5,5,20,0,20,12,0,28,12,0,12,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,
0,0,0,0,12,
0,0,0,0,
0,0,0,0,20,20,
12,12,
Expand All @@ -633,7 +633,7 @@ final class EventHandler extends KissObject
28,28,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,20,0,0,28,12,0,12,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,
0,0,0,0,12,
0,0,0,0,
0,0,0,0,12,20,
0,0,
Expand Down
15 changes: 11 additions & 4 deletions src/Kisekae/FKissAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -2785,10 +2785,10 @@ else if (!OptionsDialog.getVariableCase() && s.equalsIgnoreCase(context))

// Get the repeat and minimize options.

n1 = 0 ;
n2 = 1 ;
n3 = 0 ;
n4 = 0 ;
n1 = 0 ; // repeat
n2 = 1 ; // minimized
n3 = 0 ; // x position
n4 = 0 ; // y position
if (parameters.size() > 1)
n1 = variable.getIntValue((String) parameters.elementAt(1),event) ;
if (parameters.size() > 2)
Expand Down Expand Up @@ -2822,6 +2822,13 @@ else if (!OptionsDialog.getVariableCase() && s.equalsIgnoreCase(context))
MainFrame mainframe = Kisekae.getMainFrame() ;
if (mainframe != null) mainframe.toFront() ;
}
else
{
MainMenu mainmenu = null ;
MainFrame mainframe = Kisekae.getMainFrame() ;
if (mainframe != null) mainmenu = mainframe.getMainMenu() ;
if (mainmenu != null) mainmenu.updateRunState() ;
}
break ;

// Elseifequal compatibility.
Expand Down
33 changes: 28 additions & 5 deletions src/Kisekae/Kisekae.java
Original file line number Diff line number Diff line change
Expand Up @@ -2020,10 +2020,32 @@ public static void restart()
System.out.println("Application restarted.") ;
mainframe = new MainFrame(kisekae,file,true) ;
if (mainframe1 != null) mainframe1.dispose() ;
}


}


// Set global uncaught exception handler for Event Dispatch Thread.
// We can occasionally see a NullPointerException in Swing code.
// The exception writes a full stack trace which shows in the log file.
// The EDT is automatically restarted in this case so no visible problem.

public static void setupGlobalExceptionHandling()
{
Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler()
{
@Override
public void uncaughtException(Thread t, Throwable e)
{
String message = e.getMessage();
if (message == null || message.length() == 0)
message = "Java Runtime Environment: " + e.getClass();
if (t != null) message += " on thread " + t.getName() ;
System.out.println("Kisekae: Uncaught Exception " + message);
// e.printStackTrace();
}
});
}


// Application Main program.
// -------------------------

Expand All @@ -2046,8 +2068,9 @@ public static void main(String[] args)
System.out.println("Application start file is " + file) ;
if (language != null && language.length() > 0)
setLanguage(language) ;



setupGlobalExceptionHandling() ;

// Initialize the application frame.

try
Expand Down
7 changes: 4 additions & 3 deletions src/Kisekae/LogFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ final public class LogFile extends PrintStream
private static boolean tracewrite = false ;
private static int byteswritten = 0 ;
private static boolean error = false ;
private static int maxbytes = 10000000 ; // 10 MB max file size

static OutputStream logfile ;
static PrintStream oldStdout ;
Expand Down Expand Up @@ -220,7 +221,7 @@ public void write(int b)
if (logfile == null) return ;
try
{
if (byteswritten <= 10000000) // 10 MB limit
if (byteswritten <= maxbytes)
{
logfile.write(b) ;
if (!Kisekae.inApplet()) super.write(b);
Expand Down Expand Up @@ -284,15 +285,15 @@ public void write(byte buf[], int off, int len)
if (trace != null && !tracewrite && !OptionsDialog.getDebugDisabled()) return ;
try
{
if (byteswritten <= 10000000) // 10 MB limit
if (byteswritten <= maxbytes)
{
logfile.write(buf, off, len) ;
if (!Kisekae.inApplet()) super.write(buf, off, len) ;
byteswritten += len ;
}
else
{
if (!error) System.out.println("LogFile: Exceed 10 MB log file size " + logfilename) ;
if (!error) System.out.println("LogFile: Exceed maximum log file size " + logfilename) ;
setError();
error = true ;
}
Expand Down
7 changes: 5 additions & 2 deletions src/Kisekae/MainMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -855,8 +855,11 @@ public void actionPerformed(ActionEvent evt)
KissFrame f = (KissFrame) windows.elementAt(i) ;
if (s.equals(f.getTitle()))
{
if (f.getState() == Frame.ICONIFIED)
f.setState(Frame.NORMAL) ;
if (f instanceof MediaFrame)
{
((MediaFrame) f).setMinimized(false) ;
((MediaFrame) f).setVisible(true) ;
}
f.toFront() ;
break ;
}
Expand Down
52 changes: 21 additions & 31 deletions src/Kisekae/MediaFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,6 @@ private void init()
aspectratio.setState(OptionsDialog.getKeepAspect());
aspectratio.addItemListener(this) ;
mb.add(optionMenu) ;

windowMenu = new JMenu(Kisekae.getCaptions().getString("MenuWindow")) ;
windowMenu.setMargin(insets) ;
if (!applemac) windowMenu.setMnemonic(KeyEvent.VK_W) ;
mb.add(windowMenu) ;

// Create the Help menu and About dialog.

Expand Down Expand Up @@ -762,25 +757,28 @@ public void itemStateChanged(ItemEvent evt)
return ;
}

else if (source == fullscreen)
if (source == fullscreen)
{
OptionsDialog.setAutoFullScreen(fullscreen.getState()) ;
return ;
}

else if (source == minimize)
if (source == minimize)
{
OptionsDialog.setMediaMinimize(minimize.getState()) ;
boolean b = minimize.getState() ;
OptionsDialog.setMediaMinimize(b) ;
setMinimized(b) ;
setVisible(!b) ;
return ;
}

else if (source == centerframe)
if (source == centerframe)
{
OptionsDialog.setMediaCenter(centerframe.getState()) ;
return ;
}

else if (source == aspectratio)
if (source == aspectratio)
{
OptionsDialog.setKeepAspect(aspectratio.getState()) ;
return ;
Expand Down Expand Up @@ -811,24 +809,13 @@ public void menuSelected(MenuEvent evt)

// Implementation of the menu item update of our state when we become
// visible. We remove all prior entries and rebuild the Window menu.

void updateRunState()
{
for (int j = windowMenu.getItemCount()-1 ; j >= 0 ; j--)
windowMenu.remove(j) ;

// Add new dialog entries

int n = 0 ;
Vector v = KissFrame.getWindowFrames() ;
for (int i = 0 ; i < v.size() ; i++)
{
KissFrame w = (KissFrame) v.elementAt(i) ;
String s = w.getTitle() ;
JMenuItem mi = new JMenuItem(++n + ". " + s) ;
mi.addActionListener(this) ;
windowMenu.add(mi) ;
}
MainMenu mainmenu = null ;
MainFrame mainframe = Kisekae.getMainFrame() ;
if (mainframe != null) mainmenu = mainframe.getMainMenu() ;
if (mainmenu != null) mainmenu.updateRunState() ;
}


Expand All @@ -849,8 +836,8 @@ public void windowDeactivated(WindowEvent evt) { }
private void setValues()
{
String title = Kisekae.getCaptions().getString("MediaPlayerTitle") ;
if (audio != null) title = audio.toString() ;
if (video != null) title = video.toString() ;
if (audio != null) title += " - " + audio.toString() ;
if (video != null) title += " - " + video.toString() ;
setTitle(title) ;
select.setEnabled(fd != null) ;
saveas.setEnabled(playlist != null && !Kisekae.isSecure()) ;
Expand Down Expand Up @@ -1012,9 +999,10 @@ void play()
int state = player.getState() ;
realized = (state >= Player.Realized) ;
}
updateLayout() ;
setValues() ;
}
}
updateLayout() ;
setValues() ;
updateRunState() ;

// Start playing the media file.

Expand Down Expand Up @@ -1108,6 +1096,8 @@ void play(ArchiveEntry ze)
save.setEnabled(false) ;
fd = ze.getFileOpen() ;
if (fd != null) { fd.open(ze.getPath()) ; ze = fd.getZipEntry() ; }
if (ze == null) return ;

if (ze.isAudioSound())
ko = new AudioSound(ze.getZipFile(),ze.getPath()) ;
if (ze.isAudioMedia())
Expand Down
1 change: 1 addition & 0 deletions src/Kisekae/Messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1405,6 +1405,7 @@ UpdateDialogText=This set may have been modified. Save changes?
#URLLoader
URLLoadingText=Loading URL [URL]
JARLoadingText=Loading JAR [URL]
FileNotFound=File not found.

#VariableDialog
VariableDialogTitle=Configuration Variables
Expand Down
Loading

0 comments on commit a1bb74f

Please sign in to comment.