diff --git a/buildPy2exe.py b/buildPy2exe.py index d023740..d9158d3 100755 --- a/buildPy2exe.py +++ b/buildPy2exe.py @@ -651,7 +651,8 @@ guiIcons = glob('syncplay/resources/*.ico') + glob('syncplay/resources/*.png') + resources = [ "syncplay/resources/syncplayintf.lua", "syncplay/resources/license.rtf", - "syncplay/resources/third-party-notices.txt" + "syncplay/resources/third-party-notices.txt", + "syncplay/resources/plugins/win64/libsyncplay_chat_plugin.dll" ] resources.extend(guiIcons) intf_resources = ["syncplay/resources/lua/intf/syncplay.lua"] diff --git a/syncplay/resources/lua/intf/syncplay.lua b/syncplay/resources/lua/intf/syncplay.lua index 17d0c68..dcedba5 100644 --- a/syncplay/resources/lua/intf/syncplay.lua +++ b/syncplay/resources/lua/intf/syncplay.lua @@ -502,6 +502,7 @@ function do_command ( command, argument) elseif command == "get-filepath" then response = "filepath"..msgseperator..errormerge(get_filepath())..msgterminator elseif command == "get-filename" then response = "filename"..msgseperator..errormerge(get_filename())..msgterminator elseif command == "get-title" then response = "title"..msgseperator..errormerge(get_var("title", 0))..msgterminator + elseif command == "chat" then response = "chat"..msgseperator..argument..msgterminator elseif command == "set-position" then errormsg = set_time(radixsafe_tonumber(argument)) elseif command == "seek-within-title" then errormsg = set_var("time", radixsafe_tonumber(argument)) elseif command == "set-playstate" then errormsg = set_playstate(argument) @@ -559,6 +560,7 @@ end -- main loop, which alternates between writing and reading while running == true do + --accept new connections and select active clients local quitcheckcounter = 0 local fd = l:accept() @@ -610,7 +612,17 @@ while running == true do if (responsebuffer and running == true) then vlc.net.send( fd, responsebuffer ) responsebuffer = "" - end + else + local libvlc = vlc.object.libvlc() + if libvlc then + local message = vlc.var.get(libvlc, "chat-message") + if message ~= nil and string.len(message) > 0 then + vlc.msg.warn(message) + vlc.net.send(fd, do_command("chat", message)) + vlc.var.set(libvlc, "chat-message", "") + end + end + end vlc.misc.mwait(vlc.misc.mdate() + loopsleepduration) -- Don't waste processor time -- check if VLC has been closed diff --git a/syncplay/resources/plugins/win64/libsyncplay_chat_plugin.dll b/syncplay/resources/plugins/win64/libsyncplay_chat_plugin.dll new file mode 100644 index 0000000..48ba347 Binary files /dev/null and b/syncplay/resources/plugins/win64/libsyncplay_chat_plugin.dll differ