Author: titmuss
Date: Thu Nov 27 08:55:59 2008
New Revision: 3453
URL: http://svn.slimdevices.com?rev=3453&root=Jive&view=rev
Log:
Bug: N/A
Description:
Refactor system properites and path functions from jive.ui.Framework into
jive.System. Added additional methods
to return the system architecture (i386, arm, etc) and system machine
(squeezeplay for desktop, jive, etc).
Added:
7.4/trunk/squeezeplay/src/squeezeplay/share/jive/System.lua
7.4/trunk/squeezeplay/src/squeezeplay/src/ui/platform_linux.c
- copied, changed from r3450,
7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework_linux.c
7.4/trunk/squeezeplay/src/squeezeplay/src/ui/platform_osx.c
- copied, changed from r3450,
7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework_osx.c
7.4/trunk/squeezeplay/src/squeezeplay/src/ui/platform_windows.c
- copied, changed from r3450,
7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework_windows.c
Removed:
7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework_linux.c
7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework_osx.c
7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework_windows.c
Modified:
7.4/trunk/squeezeplay/src/squeezeplay/Makefile.am
7.4/trunk/squeezeplay/src/squeezeplay/Makefile.in
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/AboutJive/AboutJiveApplet.lua
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/Playback/PlaybackApplet.lua
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/Playback/PlaybackMeta.lua
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/Screenshot/ScreenshotApplet.lua
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SetupSoundEffects/SetupSoundEffectsApplet.lua
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SetupWallpaper/SetupWallpaperApplet.lua
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SlimDiscovery/SlimDiscoveryApplet.lua
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SqueezeNetworkPIN/SqueezeNetworkPINApplet.lua
7.4/trunk/squeezeplay/src/squeezeplay/share/jive/AppletManager.lua
7.4/trunk/squeezeplay/src/squeezeplay/share/jive/JiveMain.lua
7.4/trunk/squeezeplay/src/squeezeplay/share/jive/audio/Playback.lua
7.4/trunk/squeezeplay/src/squeezeplay/share/jive/net/Comet.lua
7.4/trunk/squeezeplay/src/squeezeplay/share/jive/net/NetworkThread.lua
7.4/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Framework.lua
7.4/trunk/squeezeplay/src/squeezeplay/share/jive/utils/locale.lua
7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive.h
7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework.c
7.4/trunk/squeezeplay/src/squeezeplay_contrib/share/applets/Test/TestApplet.lua
7.4/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/DesktopJive/DesktopJiveMeta.lua
7.4/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SqueezeboxJive/SqueezeboxJiveApplet.lua
7.4/trunk/squeezeplay/src/squeezeplay_squeezeos/share/applets/SetupFirmwareUpgrade/SetupFirmwareUpgradeApplet.lua
Modified: 7.4/trunk/squeezeplay/src/squeezeplay/Makefile.am
URL:
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/Makefile.am?rev=3453&root=Jive&r1=3452&r2=3453&view=diff
==============================================================================
--- 7.4/trunk/squeezeplay/src/squeezeplay/Makefile.am (original)
+++ 7.4/trunk/squeezeplay/src/squeezeplay/Makefile.am Thu Nov 27 08:55:59 2008
@@ -151,15 +151,16 @@
src/ui/jive_event.c \
src/ui/jive_font.c \
src/ui/jive_framework.c \
- src/ui/jive_framework_osx.c \
- src/ui/jive_framework_linux.c \
src/ui/jive_group.c \
src/ui/jive_icon.c \
src/ui/jive_label.c \
src/ui/jive_menu.c \
+ src/ui/platform_osx.c \
+ src/ui/platform_linux.c \
src/ui/jive_slider.c \
src/ui/jive_style.c \
src/ui/jive_surface.c \
+ src/ui/system.c \
src/ui/jive_textarea.c \
src/ui/jive_textinput.c \
src/ui/jive_tile.c \
Modified: 7.4/trunk/squeezeplay/src/squeezeplay/Makefile.in
URL:
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/Makefile.in?rev=3453&root=Jive&r1=3452&r2=3453&view=diff
==============================================================================
--- 7.4/trunk/squeezeplay/src/squeezeplay/Makefile.in (original)
+++ 7.4/trunk/squeezeplay/src/squeezeplay/Makefile.in Thu Nov 27 08:55:59 2008
@@ -75,11 +75,11 @@
libjivenet_la_OBJECTS = $(am_libjivenet_la_OBJECTS)
libjiveui_la_DEPENDENCIES =
am_libjiveui_la_OBJECTS = jive_event.lo jive_font.lo jive_framework.lo \
- jive_framework_osx.lo jive_framework_linux.lo jive_group.lo \
- jive_icon.lo jive_label.lo jive_menu.lo jive_slider.lo \
- jive_style.lo jive_surface.lo jive_textarea.lo \
- jive_textinput.lo jive_tile.lo jive_timer.lo jive_utils.lo \
- jive_widget.lo jive_window.lo lua_jiveui.lo
+ jive_group.lo jive_icon.lo jive_label.lo jive_menu.lo \
+ platform_osx.lo platform_linux.lo jive_slider.lo jive_style.lo \
+ jive_surface.lo system.lo jive_textarea.lo jive_textinput.lo \
+ jive_tile.lo jive_timer.lo jive_utils.lo jive_widget.lo \
+ jive_window.lo lua_jiveui.lo
libjiveui_la_OBJECTS = $(am_libjiveui_la_OBJECTS)
am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(testdir)"
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
@@ -274,15 +274,16 @@
src/ui/jive_event.c \
src/ui/jive_font.c \
src/ui/jive_framework.c \
- src/ui/jive_framework_osx.c \
- src/ui/jive_framework_linux.c \
src/ui/jive_group.c \
src/ui/jive_icon.c \
src/ui/jive_label.c \
src/ui/jive_menu.c \
+ src/ui/platform_osx.c \
+ src/ui/platform_linux.c \
src/ui/jive_slider.c \
src/ui/jive_style.c \
src/ui/jive_surface.c \
+ src/ui/system.c \
src/ui/jive_textarea.c \
src/ui/jive_textinput.c \
src/ui/jive_tile.c \
@@ -485,8 +486,6 @@
@AMDEP_TRUE@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@
@AMDEP_TRUE@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@
@AMDEP_TRUE@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@
[EMAIL PROTECTED]@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@
[EMAIL PROTECTED]@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@
@AMDEP_TRUE@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@
@AMDEP_TRUE@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@
@AMDEP_TRUE@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@
@@ -504,7 +503,10 @@
@AMDEP_TRUE@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@
@AMDEP_TRUE@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@
@AMDEP_TRUE@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@
[EMAIL PROTECTED]@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@
[EMAIL PROTECTED]@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@
@AMDEP_TRUE@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@
[EMAIL PROTECTED]@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c
-o $@ $<; \
@@ -653,20 +655,6 @@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE)
$(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS)
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS)
$(CFLAGS) -c -o jive_framework.lo `test -f 'src/ui/jive_framework.c' || echo
'$(srcdir)/'`src/ui/jive_framework.c
-jive_framework_osx.lo: src/ui/jive_framework_osx.c
[EMAIL PROTECTED]@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS)
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS)
$(CFLAGS) -MT jive_framework_osx.lo -MD -MP -MF
"$(DEPDIR)/jive_framework_osx.Tpo" -c -o jive_framework_osx.lo `test -f
'src/ui/jive_framework_osx.c' || echo '$(srcdir)/'`src/ui/jive_framework_osx.c;
\
[EMAIL PROTECTED]@ then mv -f "$(DEPDIR)/jive_framework_osx.Tpo"
"$(DEPDIR)/jive_framework_osx.Plo"; else rm -f
"$(DEPDIR)/jive_framework_osx.Tpo"; exit 1; fi
[EMAIL PROTECTED]@@am__fastdepCC_FALSE@ source='src/ui/jive_framework_osx.c'
object='jive_framework_osx.lo' libtool=yes @AMDEPBACKSLASH@
[EMAIL PROTECTED]@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE)
$(depcomp) @AMDEPBACKSLASH@
[EMAIL PROTECTED]@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS)
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS)
$(CFLAGS) -c -o jive_framework_osx.lo `test -f 'src/ui/jive_framework_osx.c' ||
echo '$(srcdir)/'`src/ui/jive_framework_osx.c
-
-jive_framework_linux.lo: src/ui/jive_framework_linux.c
[EMAIL PROTECTED]@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS)
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS)
$(CFLAGS) -MT jive_framework_linux.lo -MD -MP -MF
"$(DEPDIR)/jive_framework_linux.Tpo" -c -o jive_framework_linux.lo `test -f
'src/ui/jive_framework_linux.c' || echo
'$(srcdir)/'`src/ui/jive_framework_linux.c; \
[EMAIL PROTECTED]@ then mv -f "$(DEPDIR)/jive_framework_linux.Tpo"
"$(DEPDIR)/jive_framework_linux.Plo"; else rm -f
"$(DEPDIR)/jive_framework_linux.Tpo"; exit 1; fi
[EMAIL PROTECTED]@@am__fastdepCC_FALSE@ source='src/ui/jive_framework_linux.c'
object='jive_framework_linux.lo' libtool=yes @AMDEPBACKSLASH@
[EMAIL PROTECTED]@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE)
$(depcomp) @AMDEPBACKSLASH@
[EMAIL PROTECTED]@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS)
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS)
$(CFLAGS) -c -o jive_framework_linux.lo `test -f
'src/ui/jive_framework_linux.c' || echo
'$(srcdir)/'`src/ui/jive_framework_linux.c
-
jive_group.lo: src/ui/jive_group.c
@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS)
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS)
$(CFLAGS) -MT jive_group.lo -MD -MP -MF "$(DEPDIR)/jive_group.Tpo" -c -o
jive_group.lo `test -f 'src/ui/jive_group.c' || echo
'$(srcdir)/'`src/ui/jive_group.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/jive_group.Tpo"
"$(DEPDIR)/jive_group.Plo"; else rm -f "$(DEPDIR)/jive_group.Tpo"; exit 1; fi
@@ -695,6 +683,20 @@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE)
$(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS)
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS)
$(CFLAGS) -c -o jive_menu.lo `test -f 'src/ui/jive_menu.c' || echo
'$(srcdir)/'`src/ui/jive_menu.c
+platform_osx.lo: src/ui/platform_osx.c
[EMAIL PROTECTED]@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS)
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS)
$(CFLAGS) -MT platform_osx.lo -MD -MP -MF "$(DEPDIR)/platform_osx.Tpo" -c -o
platform_osx.lo `test -f 'src/ui/platform_osx.c' || echo
'$(srcdir)/'`src/ui/platform_osx.c; \
[EMAIL PROTECTED]@ then mv -f "$(DEPDIR)/platform_osx.Tpo"
"$(DEPDIR)/platform_osx.Plo"; else rm -f "$(DEPDIR)/platform_osx.Tpo"; exit 1;
fi
[EMAIL PROTECTED]@@am__fastdepCC_FALSE@ source='src/ui/platform_osx.c'
object='platform_osx.lo' libtool=yes @AMDEPBACKSLASH@
[EMAIL PROTECTED]@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE)
$(depcomp) @AMDEPBACKSLASH@
[EMAIL PROTECTED]@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS)
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS)
$(CFLAGS) -c -o platform_osx.lo `test -f 'src/ui/platform_osx.c' || echo
'$(srcdir)/'`src/ui/platform_osx.c
+
+platform_linux.lo: src/ui/platform_linux.c
[EMAIL PROTECTED]@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS)
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS)
$(CFLAGS) -MT platform_linux.lo -MD -MP -MF "$(DEPDIR)/platform_linux.Tpo" -c
-o platform_linux.lo `test -f 'src/ui/platform_linux.c' || echo
'$(srcdir)/'`src/ui/platform_linux.c; \
[EMAIL PROTECTED]@ then mv -f "$(DEPDIR)/platform_linux.Tpo"
"$(DEPDIR)/platform_linux.Plo"; else rm -f "$(DEPDIR)/platform_linux.Tpo"; exit
1; fi
[EMAIL PROTECTED]@@am__fastdepCC_FALSE@ source='src/ui/platform_linux.c'
object='platform_linux.lo' libtool=yes @AMDEPBACKSLASH@
[EMAIL PROTECTED]@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE)
$(depcomp) @AMDEPBACKSLASH@
[EMAIL PROTECTED]@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS)
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS)
$(CFLAGS) -c -o platform_linux.lo `test -f 'src/ui/platform_linux.c' || echo
'$(srcdir)/'`src/ui/platform_linux.c
+
jive_slider.lo: src/ui/jive_slider.c
@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS)
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS)
$(CFLAGS) -MT jive_slider.lo -MD -MP -MF "$(DEPDIR)/jive_slider.Tpo" -c -o
jive_slider.lo `test -f 'src/ui/jive_slider.c' || echo
'$(srcdir)/'`src/ui/jive_slider.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/jive_slider.Tpo"
"$(DEPDIR)/jive_slider.Plo"; else rm -f "$(DEPDIR)/jive_slider.Tpo"; exit 1; fi
@@ -715,6 +717,13 @@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/ui/jive_surface.c'
object='jive_surface.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE)
$(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS)
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS)
$(CFLAGS) -c -o jive_surface.lo `test -f 'src/ui/jive_surface.c' || echo
'$(srcdir)/'`src/ui/jive_surface.c
+
+system.lo: src/ui/system.c
[EMAIL PROTECTED]@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS)
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS)
$(CFLAGS) -MT system.lo -MD -MP -MF "$(DEPDIR)/system.Tpo" -c -o system.lo
`test -f 'src/ui/system.c' || echo '$(srcdir)/'`src/ui/system.c; \
[EMAIL PROTECTED]@ then mv -f "$(DEPDIR)/system.Tpo"
"$(DEPDIR)/system.Plo"; else rm -f "$(DEPDIR)/system.Tpo"; exit 1; fi
[EMAIL PROTECTED]@@am__fastdepCC_FALSE@ source='src/ui/system.c'
object='system.lo' libtool=yes @AMDEPBACKSLASH@
[EMAIL PROTECTED]@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE)
$(depcomp) @AMDEPBACKSLASH@
[EMAIL PROTECTED]@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS)
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS)
$(CFLAGS) -c -o system.lo `test -f 'src/ui/system.c' || echo
'$(srcdir)/'`src/ui/system.c
jive_textarea.lo: src/ui/jive_textarea.c
@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS)
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS)
$(CFLAGS) -MT jive_textarea.lo -MD -MP -MF "$(DEPDIR)/jive_textarea.Tpo" -c -o
jive_textarea.lo `test -f 'src/ui/jive_textarea.c' || echo
'$(srcdir)/'`src/ui/jive_textarea.c; \
Modified:
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/AboutJive/AboutJiveApplet.lua
URL:
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/share/applets/AboutJive/AboutJiveApplet.lua?rev=3453&root=Jive&r1=3452&r2=3453&view=diff
==============================================================================
---
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/AboutJive/AboutJiveApplet.lua
(original)
+++
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/AboutJive/AboutJiveApplet.lua
Thu Nov 27 08:55:59 2008
@@ -11,6 +11,7 @@
local io = require("io")
local Applet = require("jive.Applet")
+local System = require("jive.System")
local Framework = require("jive.ui.Framework")
local Label = require("jive.ui.Label")
local Textarea = require("jive.ui.Textarea")
@@ -31,13 +32,11 @@
local version = JIVE_VERSION
- local uuid, hwaddr = jnt:getUUID()
-
local about = {
tostring(self:string("ABOUT_VERSION")),
version,
"",
- tostring(self:string("ABOUT_MAC_ADDRESS", hwaddr)),
+ tostring(self:string("ABOUT_MAC_ADDRESS",
System:getMacAddress())),
"",
tostring(self:string("ABOUT_CREDITS")),
" Sean Adams",
Modified:
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/Playback/PlaybackApplet.lua
URL:
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/share/applets/Playback/PlaybackApplet.lua?rev=3453&root=Jive&r1=3452&r2=3453&view=diff
==============================================================================
---
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/Playback/PlaybackApplet.lua
(original)
+++
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/Playback/PlaybackApplet.lua
Thu Nov 27 08:55:59 2008
@@ -8,6 +8,7 @@
local table = require("jive.utils.table")
local Applet = require("jive.Applet")
+local System = require("jive.System")
local SlimServer = require("jive.slim.SlimServer")
local LocalPlayer = require("jive.slim.LocalPlayer")
@@ -59,8 +60,9 @@
if isSelected then
-- Create player instance
- local uuid, mac = jnt:getUUID()
- metaState.player = LocalPlayer(jnt,
mac, uuid)
+ local uuid = System:getUUID()
+ local playerid = System:getMacAddress()
+ metaState.player = LocalPlayer(jnt,
playerid, uuid)
else
-- Disconnect and free player
Modified:
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/Playback/PlaybackMeta.lua
URL:
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/share/applets/Playback/PlaybackMeta.lua?rev=3453&root=Jive&r1=3452&r2=3453&view=diff
==============================================================================
---
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/Playback/PlaybackMeta.lua
(original)
+++
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/Playback/PlaybackMeta.lua
Thu Nov 27 08:55:59 2008
@@ -4,6 +4,7 @@
local oo = require("loop.simple")
local AppletMeta = require("jive.AppletMeta")
+local System = require("jive.System")
local LocalPlayer = require("jive.slim.LocalPlayer")
local SlimServer = require("jive.slim.SlimServer")
@@ -55,11 +56,12 @@
-- Create player instance
- local uuid, id = jnt:getUUID()
+ local uuid = System:getUUID()
+ local playerid = System:getMacAddress()
assert(uuid)
- assert(id)
+ assert(playerid)
- meta.state.player = LocalPlayer(jnt, id, uuid)
+ meta.state.player = LocalPlayer(jnt, playerid, uuid)
-- Connect player
local server = nil
Modified:
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/Screenshot/ScreenshotApplet.lua
URL:
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/share/applets/Screenshot/ScreenshotApplet.lua?rev=3453&root=Jive&r1=3452&r2=3453&view=diff
==============================================================================
---
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/Screenshot/ScreenshotApplet.lua
(original)
+++
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/Screenshot/ScreenshotApplet.lua
Thu Nov 27 08:55:59 2008
@@ -23,6 +23,7 @@
local lfs = require("lfs")
local Applet = require("jive.Applet")
+local System = require("jive.System")
local Framework = require("jive.ui.Framework")
local Surface = require("jive.ui.Surface")
local Window = require("jive.ui.Window")
@@ -41,7 +42,7 @@
Framework:playSound("CLICK")
-- write to /media/*/log/squeezeplayXXXX.bmp or userpath
- local path = Framework.getUserPath()
+ local path = System.getUserDir()
for dir in lfs.dir("/media") do
local tmp = "/media/" .. dir .. "/log"
if lfs.attributes(tmp, "mode") == "directory" then
Modified:
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SetupSoundEffects/SetupSoundEffectsApplet.lua
URL:
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SetupSoundEffects/SetupSoundEffectsApplet.lua?rev=3453&root=Jive&r1=3452&r2=3453&view=diff
==============================================================================
---
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SetupSoundEffects/SetupSoundEffectsApplet.lua
(original)
+++
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SetupSoundEffects/SetupSoundEffectsApplet.lua
Thu Nov 27 08:55:59 2008
@@ -28,6 +28,7 @@
local lfs = require("lfs")
local Applet = require("jive.Applet")
+local System = require("jive.System")
local Checkbox = require("jive.ui.Checkbox")
local RadioButton = require("jive.ui.RadioButton")
local RadioGroup = require("jive.ui.RadioGroup")
@@ -61,7 +62,7 @@
module(...)
oo.class(_M, Applet)
-local path =
string.match(Framework:findFile("applets/SetupSoundEffects/sounds/bump.wav"),
"(.*)bump.wav")
+local path =
string.match(System:findFile("applets/SetupSoundEffects/sounds/bump.wav"),
"(.*)bump.wav")
log:info("path: ", path)
local REFRESH_TIME = 300
Modified:
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SetupWallpaper/SetupWallpaperApplet.lua
URL:
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SetupWallpaper/SetupWallpaperApplet.lua?rev=3453&root=Jive&r1=3452&r2=3453&view=diff
==============================================================================
---
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SetupWallpaper/SetupWallpaperApplet.lua
(original)
+++
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SetupWallpaper/SetupWallpaperApplet.lua
Thu Nov 27 08:55:59 2008
@@ -30,6 +30,7 @@
local lfs = require("lfs")
local Applet = require("jive.Applet")
+local System = require("jive.System")
local Framework = require("jive.ui.Framework")
local RadioButton = require("jive.ui.RadioButton")
local RadioGroup = require("jive.ui.RadioGroup")
@@ -99,7 +100,7 @@
-- find where to store wallpapers
-- we need to look for an actual file here as findFile can't find
directories on windows, so try a known wallpaper
- prefix = string.match(Framework:findFile(PREFIX .. "sunrise.png"),
"(.*)sunrise.png")
+ prefix = string.match(System:findFile(PREFIX .. "sunrise.png"),
"(.*)sunrise.png")
log:info("prefix: ", prefix)
end
Modified:
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SlimDiscovery/SlimDiscoveryApplet.lua
URL:
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SlimDiscovery/SlimDiscoveryApplet.lua?rev=3453&root=Jive&r1=3452&r2=3453&view=diff
==============================================================================
---
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SlimDiscovery/SlimDiscoveryApplet.lua
(original)
+++
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SlimDiscovery/SlimDiscoveryApplet.lua
Thu Nov 27 08:55:59 2008
@@ -29,6 +29,7 @@
local table = require("jive.utils.table")
local Applet = require("jive.Applet")
+local System = require("jive.System")
local Framework = require("jive.ui.Framework")
local Timer = require("jive.ui.Timer")
@@ -261,7 +262,7 @@
-- Special case Squeezenetwork
- if jnt:getUUID() then
+ if System:getUUID() then
squeezenetwork = SlimServer(jnt, "SqueezeNetwork")
self:_serverUpdateAddress(squeezenetwork, jnt:getSNHostname(),
9000)
end
Modified:
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SqueezeNetworkPIN/SqueezeNetworkPINApplet.lua
URL:
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SqueezeNetworkPIN/SqueezeNetworkPINApplet.lua?rev=3453&root=Jive&r1=3452&r2=3453&view=diff
==============================================================================
---
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SqueezeNetworkPIN/SqueezeNetworkPINApplet.lua
(original)
+++
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SqueezeNetworkPIN/SqueezeNetworkPINApplet.lua
Thu Nov 27 08:55:59 2008
@@ -7,6 +7,7 @@
local table = require("jive.utils.table")
local Applet = require("jive.Applet")
+local System = require("jive.System")
local Framework = require("jive.ui.Framework")
local Icon = require("jive.ui.Icon")
local Label = require("jive.ui.Label")
@@ -90,7 +91,7 @@
function _checkLinked(self, server, next, fail)
-- When the user clicks the button, ask SN if we're registered
- local uuid, mac = jnt:getUUID()
+ local uuid = System:getUUID()
local cmd = { 'islinked', uuid }
local checkLinkedSink = function(chunk, err)
Modified: 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/AppletManager.lua
URL:
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/share/jive/AppletManager.lua?rev=3453&root=Jive&r1=3452&r2=3453&view=diff
==============================================================================
--- 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/AppletManager.lua
(original)
+++ 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/AppletManager.lua Thu Nov
27 08:55:59 2008
@@ -34,7 +34,8 @@
local locale = require("jive.utils.locale")
local dumper = require("jive.utils.dumper")
local table = require("jive.utils.table")
-local Framework = require("jive.ui.Framework")
+
+local System = require("jive.System")
local JIVE_VERSION = jive.JIVE_VERSION
local EVENT_ACTION = jive.ui.EVENT_ACTION
@@ -84,7 +85,7 @@
function _initUserpathdir()
- _userpathdir = Framework.getUserPath()
+ _userpathdir = System.getUserDir()
_usersettingsdir = _userpathdir .. "/settings"
log:info("User Path: ", _userpathdir)
@@ -741,10 +742,6 @@
package.loaded[entry.appletModule] = nil
end
-function getUserPath(self)
- return _userpathdir
-end
-
function _getDefaultSettings(appletName)
return _defaultSettingsByAppletName[appletName]
end
Modified: 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/JiveMain.lua
URL:
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/share/jive/JiveMain.lua?rev=3453&root=Jive&r1=3452&r2=3453&view=diff
==============================================================================
--- 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/JiveMain.lua (original)
+++ 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/JiveMain.lua Thu Nov 27
08:55:59 2008
@@ -49,6 +49,7 @@
local NetworkThread = require("jive.net.NetworkThread")
local Iconbar = require("jive.Iconbar")
local AppletManager = require("jive.AppletManager")
+local System = require("jive.System")
local locale = require("jive.utils.locale")
local SimpleMenu = require("jive.ui.SimpleMenu")
local Window = require("jive.ui.Window")
@@ -166,8 +167,8 @@
local function _addUserPathToLuaPath()
local dirSeparator = package.path:match( "(%p)%?%." )
- package.path = package.path .. Framework.getUserPath() .. dirSeparator
.."?.lua;"
- package.path = package.path .. Framework.getUserPath() .. dirSeparator ..
"?" .. dirSeparator .. "?.lua;"
+ package.path = package.path .. System.getUserDir() .. dirSeparator
.."?.lua;"
+ package.path = package.path .. System.getUserDir() .. dirSeparator .. "?"
.. dirSeparator .. "?.lua;"
end
-- __init
Added: 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/System.lua
URL:
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/share/jive/System.lua?rev=3453&root=Jive&view=auto
==============================================================================
--- 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/System.lua (added)
+++ 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/System.lua Thu Nov 27
08:55:59 2008
@@ -1,0 +1,59 @@
+
+--[[
+=head1 NAME
+
+jive.System - system properties
+
+=head1 DESCRIPTION
+
+Access system specific properties, including files.
+
+
+=head2 System:getUUID()
+
+Return the SqueezePlay UUID.
+
+=head2 System:getMacAddress()
+
+Return the mac address, used as a unique id by SqueezePlay.
+
+=head2 System:getArch()
+
+Return the system architecture (e.g. i386, armv5tejl, etc).
+
+=head2 System:getMachine()
+
+Return the machine (e.g. squeezeplay, jive, etc).
+
+=head2 System:getUserPath()
+
+Return the user-specific path that holds settings, 3rd-party applets,
wallpaper, etc. The path is part of the overall Lua path.
+
+=head2 System.findFile(path)
+
+Find a file on the lua path. Returns the full path of the file, or nil if it
was not found.
+
+--]]
+
+local oo = require("loop.simple")
+
+
+-- our class
+module(...)
+oo.class(_M, System)
+
+
+-- C implementation
+
+
+--[[
+
+=head1 LICENSE
+
+Copyright 2007 Logitech. All Rights Reserved.
+
+This file is subject to the Logitech Public Source License Version 1.0. Please
see the LICENCE file for details.
+
+=cut
+--]]
+
Modified: 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/audio/Playback.lua
URL:
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/share/jive/audio/Playback.lua?rev=3453&root=Jive&r1=3452&r2=3453&view=diff
==============================================================================
--- 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/audio/Playback.lua
(original)
+++ 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/audio/Playback.lua Thu Nov
27 08:55:59 2008
@@ -270,6 +270,8 @@
function _streamConnect(self, serverIp, serverPort)
+
+log:warn("CONNECT TO ", serverIp)
self.stream = Stream:connect(serverIp, serverPort)
log:info("connect streambuf")
Modified: 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/net/Comet.lua
URL:
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/share/jive/net/Comet.lua?rev=3453&root=Jive&r1=3452&r2=3453&view=diff
==============================================================================
--- 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/net/Comet.lua (original)
+++ 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/net/Comet.lua Thu Nov 27
08:55:59 2008
@@ -62,6 +62,7 @@
local oo = require("loop.simple")
local math = require("math")
+local System = require("jive.System")
local CometRequest = require("jive.net.CometRequest")
local HttpPool = require("jive.net.HttpPool")
local SocketHttp = require("jive.net.SocketHttp")
@@ -575,17 +576,14 @@
-- Reset clientId
self.clientId = nil
-
- local uuid, mac = self.jnt:getUUID()
-
local data = { {
channel = '/meta/handshake',
version = '1.0',
supportedConnectionTypes = { 'streaming' },
ext = {
rev = JIVE_VERSION,
- mac = mac,
- uuid = uuid
+ mac = System:getMacAddress(),
+ uuid = System:getUUID(),
},
} }
Modified: 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/net/NetworkThread.lua
URL:
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/share/jive/net/NetworkThread.lua?rev=3453&root=Jive&r1=3452&r2=3453&view=diff
==============================================================================
--- 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/net/NetworkThread.lua
(original)
+++ 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/net/NetworkThread.lua Thu
Nov 27 08:55:59 2008
@@ -39,6 +39,7 @@
local debug = require("jive.utils.debug")
local oo = require("loop.base")
+local System = require("jive.System")
local Event = require("jive.ui.Event")
local Framework = require("jive.ui.Framework")
local Task = require("jive.ui.Task")
@@ -340,31 +341,14 @@
end
-
---[[
-
-=head2 getUUID()
-
-Returns the UUID and Mac address of this device.
-
-=cut
---]]
+-- deprecated
function getUUID(self)
- return self.uuid, self.mac
-end
-
-
---[[
-
-=head2 setUUID(uuid, mac)
-
-Sets the UUID and Mac address of this device.
-
-=cut
---]]
+ return System:getUUID(), System:getMacAddress()
+end
+
+
function setUUID(self, uuid, mac)
- self.uuid = uuid
- self.mac = string.lower(mac)
+ _assert(false, "NetworkThread:setUUID is deprecated")
end
Modified: 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Framework.lua
URL:
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Framework.lua?rev=3453&root=Jive&r1=3452&r2=3453&view=diff
==============================================================================
--- 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Framework.lua (original)
+++ 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Framework.lua Thu Nov
27 08:55:59 2008
@@ -50,6 +50,7 @@
local math = require("math")
+local System = require("jive.System")
local Checkbox = require("jive.ui.Checkbox")
local Choice = require("jive.ui.Choice")
local Event = require("jive.ui.Event")
@@ -131,21 +132,9 @@
Dispatch an event I<event> to the listeners of the widget I<widget>. Any
global event listeners are called first. If I<widget> is nil then the event
will be sent to the top most window. This can only be called from the main
thread.
-=head2 jive.ui.Framework.findFile(path)
-
-Find a file on the lua path. Returns the full path of the file, or nil if it
was not found.
-
=head2 jive.ui.Framework:getTicks()
Return the number of milliseconds since the Jive initialization.
-
-=head2 jive.ui.Framework:getMacAddress()
-
-Return the first Mac address found on the current system.
-
-=head2 jive.ui.Framework:getUserPath()
-
-Return the user-specific path that holds settings, 3rd-party applets,
wallpaper, etc. THe path is aprt of the overall Lua path.
=head2 jive.ui.Framework:threadTicks()
@@ -563,7 +552,7 @@
-- One-shot initialization, the first
-- time someone accesses a Global Setting
- global_settings_file =
self:findFile("jive/JiveMain.lua"):sub(1,-13)
+ global_settings_file =
System:findFile("jive/JiveMain.lua"):sub(1,-13)
.. "global_settings.txt"
local fh = io.open(global_settings_file)
Modified: 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/utils/locale.lua
URL:
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/share/jive/utils/locale.lua?rev=3453&root=Jive&r1=3452&r2=3453&view=diff
==============================================================================
--- 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/utils/locale.lua (original)
+++ 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/utils/locale.lua Thu Nov
27 08:55:59 2008
@@ -21,7 +21,8 @@
local ipairs, pairs, io, select, setmetatable, string, tostring = ipairs,
pairs, io, select, setmetatable, string, tostring
local log = require("jive.utils.log").logger("utils")
-local Framework = require("jive.ui.Framework")
+
+local System = require("jive.System")
local Task = require("jive.ui.Task")
module(...)
@@ -104,7 +105,7 @@
--]]
function readGlobalStringsFile(self)
- local globalStringsPath = Framework:findFile("jive/global_strings.txt")
+ local globalStringsPath = System:findFile("jive/global_strings.txt")
if globalStringsPath == nil then
return globalStrings
end
Modified: 7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive.h
URL:
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive.h?rev=3453&root=Jive&r1=3452&r2=3453&view=diff
==============================================================================
--- 7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive.h (original)
+++ 7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive.h Thu Nov 27 08:55:59 2008
@@ -260,12 +260,16 @@
extern int (*jive_sdlevent_pump)(lua_State *L);
extern int (*jive_sdlfilter_pump)(const SDL_Event *event);
-extern void (*get_app_home_dir_platform)(char *path);
-extern void (*get_mac_address)(char *address);
-void get_user_path(char *path);
-void get_app_home_dir(char *path);
-void jive_platform_init(lua_State *L);
void jive_send_key_event(JiveEventType keyType, JiveKey keyCode);
+
+
+/* platform functions */
+void platform_init(lua_State *L);
+char *platform_get_mac_address();
+char *platform_get_home_dir();
+char *platform_get_arch();
+
+int squeezeplayL_system_init(lua_State *L);
/* global counter used to invalidate widget */
@@ -477,7 +481,6 @@
int jiveL_timer_remove_timer(lua_State *L);
-
#define JIVEL_STACK_CHECK_BEGIN(L) { int _sc = lua_gettop((L));
#define JIVEL_STACK_CHECK_ASSERT(L) assert(_sc == lua_gettop((L)));
#define JIVEL_STACK_CHECK_END(L) JIVEL_STACK_CHECK_ASSERT(L) }
Modified: 7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework.c
URL:
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework.c?rev=3453&root=Jive&r1=3452&r2=3453&view=diff
==============================================================================
--- 7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework.c (original)
+++ 7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework.c Thu Nov 27
08:55:59 2008
@@ -14,10 +14,6 @@
int (*jive_sdlevent_pump)(lua_State *L);
int (*jive_sdlfilter_pump)(const SDL_Event *event);
-void (*get_app_home_dir_platform)(char *path);
-void (*get_mac_address)(char *address);
-
-char *jive_resource_path = NULL;
SDL_Rect jive_dirty_region;
@@ -90,7 +86,6 @@
};
-static int init_path(lua_State *L);
static int process_event(lua_State *L, SDL_Event *event);
static int filter_events(const SDL_Event *event);
int jiveL_update_screen(lua_State *L);
@@ -119,8 +114,6 @@
JiveSurface *srf, *splash, *icon;
Uint16 splash_w, splash_h;
- init_path(L);
-
/* screen properties */
lua_getfield(L, 1, "screen");
if (lua_isnil(L, -1)) {
@@ -152,7 +145,7 @@
SDL_EventState(SDL_SYSWMEVENT,SDL_ENABLE);
SDL_SetEventFilter(filter_events);
- jive_platform_init(L);
+ platform_init(L);
/* open window */
SDL_WM_SetCaption("SqueezePlay Beta", "SqueezePlay Beta");
@@ -193,57 +186,6 @@
lua_setfield(L, -2, "style");
lua_pop(L, 2);
- return 0;
-}
-
-static int init_path(lua_State *L) {
- const char *lua_path;
- char *ptr;
-
- /* set jiveui_path from lua path */
- lua_getglobal(L, "package");
- if (!lua_istable(L, -1)) {
- lua_pop(L, 1);
- return 0;
- }
-
- lua_getfield(L, -1, "path");
- if (!lua_isstring(L, -1)) {
- lua_pop(L, 2);
- return 0;
- }
-
- lua_path = lua_tostring(L, -1);
-
- if (jive_resource_path) {
- free(jive_resource_path);
- }
- jive_resource_path = malloc(strlen(lua_path) + 1);
-
- /* convert from lua path into jive path */
- ptr = jive_resource_path;
- while (*lua_path) {
- switch (*lua_path) {
- case '?':
- while (*lua_path && *lua_path != ';') {
- lua_path++;
- }
- break;
-
- case ';':
- *ptr++ = ';';
- while (*lua_path && *lua_path == ';') {
- lua_path++;
- }
- break;
-
- default:
- *ptr++ = *lua_path++;
- }
- }
- *ptr = '\0';
-
- lua_pop(L, 2);
return 0;
}
@@ -276,8 +218,6 @@
/* force lua GC */
lua_gc(L, LUA_GCCOLLECT, 0);
-
- free(jive_resource_path);
/* quit SDL */
SDL_Quit();
@@ -847,125 +787,16 @@
return 1;
}
+
int jiveL_get_ticks(lua_State *L) {
lua_pushinteger(L, SDL_GetTicks());
return 1;
}
-int jiveL_get_mac_address(lua_State *L) {
-
- char *macaddress = malloc(100);
-
- get_mac_address(macaddress);
-
- lua_pushstring(L, macaddress);
- free(macaddress);
-
- return 1;
-}
-
-int jiveL_get_user_path(lua_State *L) {
-
- char *userpath = malloc(PATH_MAX);
-
- get_user_path(userpath);
-
- lua_pushstring(L, userpath);
- free(userpath);
-
- return 1;
-}
-
-
-void get_app_home_dir(char *path) {
- const char *sphome = getenv("SQUEEZEPLAY_HOME");
- if (sphome != NULL) {
- strcpy(path, sphome);
- } else {
- get_app_home_dir_platform(path);
- }
-}
-
-void get_user_path(char *path) {
- get_app_home_dir(path);
- strcat(path, "/userpath");
-}
-
int jiveL_thread_time(lua_State *L) {
lua_pushinteger(L, (int)(clock() * 1000 / CLOCKS_PER_SEC));
return 1;
-}
-
-
-int jiveL_find_file(lua_State *L) {
- /* stack is:
- * 1: framework
- * 2: path
- */
-
- const char *path = luaL_checkstring(L, 2);
- char *fullpath = malloc(PATH_MAX);
-
- if (jive_find_file(path, fullpath)) {
- lua_pushstring(L, fullpath);
- }
- else {
- lua_pushnil(L);
- }
- free(fullpath);
-
- return 1;
-}
-
-
-int jive_find_file(const char *path, char *fullpath) {
- char *resource_path, *ptr;
- FILE *fp;
-
- /* absolute/relative path */
- fp = fopen(path, "r");
- if (fp) {
- fclose(fp);
- strcpy(fullpath, path);
- return 1;
- }
-
- /* search lua path */
- resource_path = strdup(jive_resource_path);
- ptr = strtok(resource_path, ";");
- while (ptr) {
-#if defined(WIN32)
- char *tmp;
-#endif
-
- strcpy(fullpath, ptr);
- strcat(fullpath, path);
-
-#if defined(WIN32)
- /* Convert from UNIX style paths */
- tmp = fullpath;
- while (*tmp) {
- if (*tmp == '/') {
- *tmp = '\\';
- }
- ++tmp;
- }
-#endif
-
- fp = fopen(fullpath, "r");
- if (fp) {
- fclose(fp);
- free(resource_path);
- return 1;
- }
-
- ptr = strtok(NULL, ";");
- }
-
- free(resource_path);
- printf("NOT FOUND %s\n", path);
- return 0;
}
@@ -1474,7 +1305,6 @@
{ "reDraw", jiveL_redraw },
{ "pushEvent", jiveL_push_event },
{ "dispatchEvent", jiveL_dispatch_event },
- { "findFile", jiveL_find_file },
{ "getTicks", jiveL_get_ticks },
{ "threadTime", jiveL_thread_time },
{ "setVideoMode", jiveL_set_video_mode },
@@ -1483,14 +1313,14 @@
{ "styleChanged", jiveL_style_changed },
{ "perfwarn", jiveL_perfwarn },
{ "_event", jiveL_event },
- { "getUserPath", jiveL_get_user_path },
- { "getMacAddress", jiveL_get_mac_address },
{ NULL, NULL }
};
static int jiveL_core_init(lua_State *L) {
+
+ squeezeplayL_system_init(L);
lua_getglobal(L, "jive");
lua_getfield(L, -1, "ui");
@@ -1521,7 +1351,7 @@
luaL_register(L, NULL, menu_methods);
lua_pop(L, 1);
- lua_getfield(L, -1, "Textarea");
+ lua_getfield(L, 2, "Textarea");
luaL_register(L, NULL, textarea_methods);
lua_pop(L, 1);
@@ -1541,7 +1371,7 @@
luaL_register(L, NULL, timer_methods);
lua_pop(L, 1);
- lua_getfield(L, -1, "Event");
+ lua_getfield(L, 2, "Event");
luaL_register(L, NULL, event_methods);
lua_pop(L, 1);
Copied: 7.4/trunk/squeezeplay/src/squeezeplay/src/ui/platform_linux.c (from
r3450, 7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework_linux.c)
URL:
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/src/ui/platform_linux.c?p2=7.4/trunk/squeezeplay/src/squeezeplay/src/ui/platform_linux.c&p1=7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework_linux.c&r1=3450&r2=3453&rev=3453&root=Jive&view=diff
==============================================================================
--- 7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework_linux.c
(original)
+++ 7.4/trunk/squeezeplay/src/squeezeplay/src/ui/platform_linux.c Thu Nov 27
08:55:59 2008
@@ -3,6 +3,7 @@
**
** This file is subject to the Logitech Public Source License Version 1.0.
Please see the LICENCE file for details.
*/
+
#ifndef __APPLE__
#include "common.h"
@@ -10,27 +11,33 @@
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/socket.h>
+#include <sys/utsname.h>
#include <netinet/in.h>
#include <linux/if.h>
-static void linux_get_app_home_dir(char *path);
-void linux_get_mac_address(char *address);
-static void linux_get_app_home_dir(char *path) {
+char *platform_get_home_dir() {
+ char *dir;
const char *home = getenv("HOME");
- strcpy(path, home);
- strcat(path, "/.squeezeplay");
+
+ dir = malloc(strlen(home) + 14);
+ strcpy(dir, home);
+ strcat(dir, "/.squeezeplay");
+
+ return dir;
}
-void linux_get_mac_address(char *address) {
+
+char *platform_get_mac_address() {
struct ifreq ifr;
struct ifreq *IFR;
struct ifconf ifc;
char buf[1024];
+ char *macaddr = NULL;
int s, i;
s = socket(AF_INET, SOCK_DGRAM, 0);
if (s==-1) {
- return ;
+ return NULL;
}
ifc.ifc_len = sizeof(buf);
@@ -47,7 +54,9 @@
//take the first found address.
//todo: can we be smarter about which is the correct
address
unsigned char * ptr = (unsigned char *)
ifr.ifr_hwaddr.sa_data;
- sprintf(address, "%02x:%02x:%02x:%02x:%02x:%02x",
*ptr,*(ptr+1), *(ptr+2),*(ptr+3), *(ptr+4), *(ptr+5));
+
+ macaddr = malloc(18);
+ sprintf(macaddr, "%02x:%02x:%02x:%02x:%02x:%02x",
*ptr,*(ptr+1), *(ptr+2),*(ptr+3), *(ptr+4), *(ptr+5));
break;
}
}
@@ -55,11 +64,21 @@
}
close(s);
+
+ return macaddr;
}
-void jive_platform_init(lua_State *L) {
- get_app_home_dir_platform = linux_get_app_home_dir;
- get_mac_address = linux_get_mac_address;
+char *platform_get_arch() {
+ struct utsname name;
+ char *arch;
+
+ uname(&name);
+
+ arch = strdup(name.machine);
+ return arch;
+}
+
+void platform_init(lua_State *L) {
}
#endif
Copied: 7.4/trunk/squeezeplay/src/squeezeplay/src/ui/platform_osx.c (from
r3450, 7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework_osx.c)
URL:
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/src/ui/platform_osx.c?p2=7.4/trunk/squeezeplay/src/squeezeplay/src/ui/platform_osx.c&p1=7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework_osx.c&r1=3450&r2=3453&rev=3453&root=Jive&view=diff
==============================================================================
--- 7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework_osx.c (original)
+++ 7.4/trunk/squeezeplay/src/squeezeplay/src/ui/platform_osx.c Thu Nov 27
08:55:59 2008
@@ -14,20 +14,27 @@
#include <ifaddrs.h>
#include <net/if_types.h>
-static void osx_get_app_home_dir(char *path);
-void osx_get_mac_address(char *address);
-static void osx_get_app_home_dir(char *path) {
+#define PREF_DIR "/Library/Preferences/SqueezePlay"
+
+char *platform_get_home_dir() {
+ char *dir;
const char *home = getenv("HOME");
+
+ dir = malloc(strlen(home) + strlen(PREF_DIR) + 1);
strcpy(path, home);
- strcat(path, "/Library/Preferences/SqueezePlay");
+ strcat(path, PREF_DIR);
+
+ return dir;
}
-void osx_get_mac_address(char *address) {
+char *platform_get_mac_address() {
struct ifaddrs* ifaphead;
struct ifaddrs* ifap;
+ char *macaddr = NULL;
+
if ( getifaddrs( &ifaphead ) != 0 )
- return;
+ return NULL;
// iterate over the net interfaces
for ( ifap = ifaphead; ifap; ifap = ifap->ifa_next )
@@ -38,20 +45,23 @@
//take the first found address.
//todo: can we be smarter about which is the correct address
unsigned char * ptr = (unsigned char *)LLADDR(sdl);
- sprintf(address, "%02x:%02x:%02x:%02x:%02x:%02x", *ptr,*(ptr+1),
*(ptr+2),*(ptr+3), *(ptr+4), *(ptr+5));
+ macaddr = malloc(18);
+ sprintf(macaddr, "%02x:%02x:%02x:%02x:%02x:%02x", *ptr,*(ptr+1),
*(ptr+2),*(ptr+3), *(ptr+4), *(ptr+5));
break;
}
}
freeifaddrs( ifaphead );
+
+ return macaddr;
}
+char *platform_get_arch() {
+ // FIXME
+ return NULL;
+}
-void jive_platform_init(lua_State *L) {
- get_app_home_dir_platform = osx_get_app_home_dir;
- get_mac_address = osx_get_mac_address;
+void platform_init(lua_State *L) {
}
#endif
-
-
Copied: 7.4/trunk/squeezeplay/src/squeezeplay/src/ui/platform_windows.c (from
r3450, 7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework_windows.c)
URL:
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/src/ui/platform_windows.c?p2=7.4/trunk/squeezeplay/src/squeezeplay/src/ui/platform_windows.c&p1=7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework_windows.c&r1=3450&r2=3453&rev=3453&root=Jive&view=diff
==============================================================================
--- 7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework_windows.c
(original)
+++ 7.4/trunk/squeezeplay/src/squeezeplay/src/ui/platform_windows.c Thu Nov 27
08:55:59 2008
@@ -15,24 +15,27 @@
#ifndef WM_APPCOMMAND
#define WM_APPCOMMAND 0x0319
#endif
-static int windows_filter_pump(const SDL_Event *event);
-static void windows_get_app_home_dir(char *path);
-void windows_get_mac_address(char *address);
-static void windows_get_app_home_dir(char *path) {
+char *platform_get_home_dir() {
+ char *dir;
const char *home = getenv("APPDATA");
- strcpy(path, home);
- strcat(path, "/SqueezePlay");
+
+ dir = malloc(strlen(home) + strlen("/SqueezePlay") + 1);
+ strcpy(dir, home);
+ strcat(dir, "/SqueezePlay");
+
+ return dir;
}
-void windows_get_mac_address(char *address) {
+char *platform_get_mac_address() {
PIP_ADAPTER_INFO pAdapterInfo;
IP_ADAPTER_INFO AdapterInfo[32];
DWORD dwBufLen = sizeof( AdapterInfo );
+ char *macaddr = NULL;
DWORD dwStatus = GetAdaptersInfo( AdapterInfo, &dwBufLen );
if ( dwStatus != ERROR_SUCCESS )
- return; // no adapters.
+ return NULL; // no adapters.
pAdapterInfo = AdapterInfo;
while ( pAdapterInfo )
@@ -40,10 +43,13 @@
//take the first found address.
//todo: can we be smarter about which is the correct address
unsigned char * ptr = (unsigned char *) pAdapterInfo->Address;
- sprintf(address, "%02x:%02x:%02x:%02x:%02x:%02x", *ptr,*(ptr+1),
*(ptr+2),*(ptr+3), *(ptr+4), *(ptr+5));
+ macaddr = malloc(18);
+ sprintf(macaddr, "%02x:%02x:%02x:%02x:%02x:%02x", *ptr,*(ptr+1),
*(ptr+2),*(ptr+3), *(ptr+4), *(ptr+5));
break;
//pAdapterInfo = pAdapterInfo->Next;
- }
+ }
+
+ return macaddr;
}
static int windows_filter_pump(const SDL_Event *event) {
@@ -80,8 +86,11 @@
return 1;
}
+char *platform_get_arch() {
+ // FIXME
+ return NULL;
+}
+
void jive_platform_init(lua_State *L) {
jive_sdlfilter_pump = windows_filter_pump;
- get_app_home_dir_platform = windows_get_app_home_dir;
- get_mac_address = windows_get_mac_address;
}
Modified:
7.4/trunk/squeezeplay/src/squeezeplay_contrib/share/applets/Test/TestApplet.lua
URL:
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay_contrib/share/applets/Test/TestApplet.lua?rev=3453&root=Jive&r1=3452&r2=3453&view=diff
==============================================================================
---
7.4/trunk/squeezeplay/src/squeezeplay_contrib/share/applets/Test/TestApplet.lua
(original)
+++
7.4/trunk/squeezeplay/src/squeezeplay_contrib/share/applets/Test/TestApplet.lua
Thu Nov 27 08:55:59 2008
@@ -27,6 +27,7 @@
local table = require("jive.utils.table")
local Applet = require("jive.Applet")
+local System = require("jive.System")
local Checkbox = require("jive.ui.Checkbox")
local Choice = require("jive.ui.Choice")
local Framework = require("jive.ui.Framework")
@@ -267,7 +268,7 @@
local window = Window("window", menuItem.text)
- filename = Framework:findFile(filename)
+ filename = System:findFile(filename)
local fh = io.open(filename, "rb")
if fh == nil then
-- FIXME error dialog
Modified:
7.4/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/DesktopJive/DesktopJiveMeta.lua
URL:
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/DesktopJive/DesktopJiveMeta.lua?rev=3453&root=Jive&r1=3452&r2=3453&view=diff
==============================================================================
---
7.4/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/DesktopJive/DesktopJiveMeta.lua
(original)
+++
7.4/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/DesktopJive/DesktopJiveMeta.lua
Thu Nov 27 08:55:59 2008
@@ -7,6 +7,7 @@
local AppletMeta = require("jive.AppletMeta")
local Framework = require("jive.ui.Framework")
+local System = require("jive.System")
local appletManager = appletManager
local jiveMain = jiveMain
@@ -32,9 +33,10 @@
function registerApplet(meta)
- --disable arp to avoid os calls, which is problematic on windows - popups,
vista permissions - disabling disables WOL functionality
- jnt:setArpEnabled(false)
-
+ --disable arp to avoid os calls, which is problematic on windows -
popups, vista permissions - disabling disables WOL functionality
+ jnt:setArpEnabled(false)
+
+
local settings = meta:getSettings()
local store = false
@@ -51,11 +53,8 @@
end
if not settings.mac then
- local mac = Framework:getMacAddress()
- if mac then
- store = true
- settings.mac = mac
- end
+ settings.mac = System:getMacAddress()
+ store = true
end
if not settings.mac then
@@ -70,13 +69,16 @@
end
if store then
- log:debug("UUID: ", settings.uuid)
- log:debug("Mac Address: ", settings.mac)
+ log:debug("Mac Address: ", settings.mac)
meta:storeSettings()
end
- -- set uuid
- jnt:setUUID(settings.uuid, settings.mac)
+ -- set mac address and uuid
+ System:init({
+ macAddress = settings.mac,
+ uuid = settings.uuid,
+ })
+
appletManager:addDefaultSetting("ScreenSavers", "whenStopped",
"false:false")
appletManager:addDefaultSetting("Playback", "enableAudio", 1)
Modified:
7.4/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SqueezeboxJive/SqueezeboxJiveApplet.lua
URL:
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SqueezeboxJive/SqueezeboxJiveApplet.lua?rev=3453&root=Jive&r1=3452&r2=3453&view=diff
==============================================================================
---
7.4/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SqueezeboxJive/SqueezeboxJiveApplet.lua
(original)
+++
7.4/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SqueezeboxJive/SqueezeboxJiveApplet.lua
Thu Nov 27 08:55:59 2008
@@ -14,6 +14,8 @@
local LocalPlayer = require("jive.slim.LocalPlayer")
local Applet = require("jive.Applet")
+local System = require("jive.System")
+
local Sample = require("squeezeplay.sample")
local Checkbox = require("jive.ui.Checkbox")
local Choice = require("jive.ui.Choice")
@@ -75,18 +77,14 @@
uuid = string.match(printenv, "serial#=(%x+)")
end
-
- -- read device mac
- local f = io.popen("/sbin/ifconfig eth0")
- if f then
- local ifconfig = f:read("*all")
- f:close()
-
- mac = string.match(ifconfig,
"HWaddr%s(%x%x:%x%x:%x%x:%x%x:%x%x:%x%x)")
- end
-
- log:info("uuid=", uuid)
- log:info("mac=", mac)
+
+ System:init({
+ uuid = uuid,
+ machine = "jive",
+ })
+
+ mac = System:getMacAddress()
+ uuid = System:getUUID()
if not uuid or string.match(mac, "^00:40:20") then
local popup = Popup("errorWindow",
self:string("INVALID_MAC_TITLE"))
@@ -111,8 +109,6 @@
popup:show()
end
-
- jnt:setUUID(uuid, mac)
-- watchdog timer
self.watchdog = Watchdog:open()
Modified:
7.4/trunk/squeezeplay/src/squeezeplay_squeezeos/share/applets/SetupFirmwareUpgrade/SetupFirmwareUpgradeApplet.lua
URL:
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay_squeezeos/share/applets/SetupFirmwareUpgrade/SetupFirmwareUpgradeApplet.lua?rev=3453&root=Jive&r1=3452&r2=3453&view=diff
==============================================================================
---
7.4/trunk/squeezeplay/src/squeezeplay_squeezeos/share/applets/SetupFirmwareUpgrade/SetupFirmwareUpgradeApplet.lua
(original)
+++
7.4/trunk/squeezeplay/src/squeezeplay_squeezeos/share/applets/SetupFirmwareUpgrade/SetupFirmwareUpgradeApplet.lua
Thu Nov 27 08:55:59 2008
@@ -20,6 +20,7 @@
local coroutine = require("coroutine")
local Applet = require("jive.Applet")
+local System = require("jive.System")
local Framework = require("jive.ui.Framework")
local Icon = require("jive.ui.Icon")
local Label = require("jive.ui.Label")
@@ -62,7 +63,9 @@
function _firmwareVersion(self, url)
- local major, minor = string.match(url, "\/jive_([^_]+)_([^_]+)\.bin")
+ local machine = System:getMachine()
+
+ local major, minor = string.match(url, "\/" .. machine ..
"_([^_]+)_([^_]+)\.bin")
if not major then
return
@@ -90,6 +93,8 @@
function _makeUpgradeItems(self, window, menu, optional, url, urlHelp)
+ local machine = System:getMachine()
+
local help = Textarea("help", "")
if url then
@@ -119,7 +124,7 @@
local fileurl = "file:" .. path .. entry
local version = self:_firmwareVersion(fileurl)
- if version or entry == "jive.bin" then
+ if version or entry == machine .. ".bin" then
menu:addItem({
text =
self:string("UPDATE_CONTINUE_SDCARD"),
sound = "WINDOWSHOW",
_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/cgi-bin/mailman/listinfo/jive-checkins