-
Notifications
You must be signed in to change notification settings - Fork 3
/
userconf-release.lua
178 lines (158 loc) · 5.36 KB
/
userconf-release.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
--- @ingroup dcplaya_lua_files
--- @file userconf.lua
--- @date 2003/03/23
---
--- @author benjamin gerard
--- @author penne vincent
---
--- @brief dcplaya lua user script.
---
--- @par userconf.lua
---
--- There is two version of this file. The first version should be in dcplaya
--- home directory, the second should have been extracted from the VMU
--- into the ramdisk "/ram/dcplaya/". These two versions are optionnal files.
--- They are executed by the dcplayarc.lua in this order. By the way their
--- execution can be skip by setting respectively skip_home_userconf and
--- skip_vmu_userconf variables. Since the home userconf is executed before
--- the VMU one, the only possiblity to set these variables is to do it in
--- the VMU dcplayarc.lua. This mechanism should be enought for any user to
--- configure its dcplaya at will (or so I hope).
--- Having an home userconf.lua file instead of doing all initialization
--- stuff in dcplayarc.lua is a development facility purpose. Each
--- dcplaya developper can have its own userconf.lua depending on its
--- need and behaviour. Because this file is subject to a lot of
--- modifications it will be a real nightmare to include it to the CVS
--- repository.
---
--- @par Default behaviours
---
--- The default userconf.lua file do the following things in this order
--- only if the __RELEASE variable is set:
--- -# Loading almost all drivers (plugins) in suitable order.
--- -# Check and load if missing the entry_list driver that should
--- have been loaded by the dcplayarc.lua
--- -# Check and load if missing the jpeg driver that should
--- have been loaded by the dcplayarc.lua
--- -# Load some dcplaya lua libraries with dolib() function. This will
--- start all standard applications neccessary for most users:
--- -# @link dcplaya_lua_background background @endlink,
--- load default background.
--- -# @link dcplaya_lua_cc_app control_center @endlink,
--- launch control-center application
--- -# @link dcplaya_lua_si_app song_info @endlink,
--- launch song-info application
--- -# @link dcplaya_lua_sb_app song_browser @endlink,
--- launch and get focus on the song-browser application.
--- -# Randomly set a vmu visual.
--- -# Randomly set a visual plugin if none is set.
---
--- @par Content
--- @code
print()
print("Executing "..home.."userconf.lua")
print(" This file : @BUILT-DATE@")
print(" Release : " .. (__RELEASE and "yes" or "no"))
print(" Debug : " .. (__DEBUG and "yes" or "no"))
print()
if __RELEASE then
local msg = "Loading drivers ... please wait"
print(msg)
local plugins
if SHADOCK_EDITION then
plugins = {
plug_obj,
plug_cdda, plug_ffmpeg,
plug_ogg, plug_mikmod, plug_sidplay,
plug_sc68, plug_nsf, plug_spc,
plug_lpo, plug_fftvlr, plug_hyperpipe, plug_fime
}
else
plugins = {
plug_obj,
plug_cdda, plug_ffmpeg, plug_ogg, plug_mikmod, plug_sidplay,
plug_sc68, plug_lpo, plug_fftvlr, plug_hyperpipe, plug_fime,
plug_spc
}
end
-- Add entrylist driver if not already loaded.
if type(entrylist_load) ~= "function" then
tinsert(plugins,plug_el)
end
-- Try to get filetype of a fake jpeg file will tell us if the jpeg driver
-- is already loaded.
local ty,ma,mi = filetype("t.jpg")
if not ma or ma ~= "image" then
tinsert(plugins,plug_jpeg)
end
local i,v
for i,v in plugins do
if type(v) == "string" then
print(format(" '%s'", v))
driver_load(v)
end
end
-- Really start dcplaya applications now !
dolib("background")
dolib("control_center")
dolib("song_info")
dolib("song_browser")
dolib("fifo_tracker")
dolib "subtitles"
if SHADOCK_EDITION then
song_browser.pl:change_dir(playlist_load(home.."../extra/radio.m3u"))
end
if fifo_tracker_create then
fifo_tracker_create()
end
-- Currently vmu visual are not plugins, just hard the list
vmu_set_visual(random(3))
-- Set visual only if no cuurent
local vis_name = set_visual()
if not SHADOCK_EDITION and not vis_name or vis_name == "" then
vis_name = nil
-- Get driver lists
local drlist = get_driver_lists()
if type(drlist) == "table" and drlist.vis and drlist.vis.n > 0 then
-- We add some visual driver, set a random one.
vis_name = drlist.vis[random(drlist.vis.n)].name
if vis_name then
print("Setting visual " .. vis_name)
set_visual(vis_name)
end
end
end
-- test again
-- vis_name = set_visual()
-- $$$ failed ? Probably becoz visual really be set in the next frame ...
if not SHADOCK_EDITION then
if not vis_name then
print("No visual plugin found :`(")
else
print("Visual plugin " .. vis_name)
end
end
if scroll_dl then
dl_set_active(scroll_dl,nil)
end
hc()
dolib("net")
sc()
if scroll_dl then
dl_set_active(scroll_dl,1)
end
if SHADOCK_EDITION then
print("Shadock edition")
print("Loading ffmpeg codecs ...")
cl(codec_misc)
print("Playing Shadock video ...")
playa_play("/cd/extra/shadock.avi")
-- TO BE REMOVED !!
-- function t()
-- dofile "/pc/home/zig/Dev/dc/newdcp/dcplaya/lua/taggedtext.lua"
-- dofile "/pc/home/zig/Dev/dc/newdcp/dcplaya/lua/net.lua"
-- end
end
hc()
end
---@endcode