summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cf6fec9)
raw | patch | inline | side by side (parent: cf6fec9)
author | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | |
Wed, 2 May 2012 14:57:58 +0000 (16:57 +0200) | ||
committer | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | |
Wed, 2 May 2012 14:57:58 +0000 (16:57 +0200) |
13 files changed:
Makefile.am | patch | blob | history | |
configure.ac | patch | blob | history | |
doc/config.sample | patch | blob | history | |
doc/ncmpc.1 | patch | blob | history | |
src/command.c | patch | blob | history | |
src/command.h | patch | blob | history | |
src/options.c | patch | blob | history | |
src/screen.c | patch | blob | history | |
src/screen_chat.c | [new file with mode: 0644] | patch | blob |
src/screen_chat.h | [new file with mode: 0644] | patch | blob |
src/screen_help.c | patch | blob | history | |
src/screen_list.c | patch | blob | history | |
src/title_bar.c | patch | blob | history |
diff --git a/Makefile.am b/Makefile.am
index 17cdb9f72b3c0f9ee52ad82c4a0ddf5495232489..ae6d5560f77d8ebdbde6c354c4fd476643efdadb 100644 (file)
--- a/Makefile.am
+++ b/Makefile.am
src/screen_keydef.h \
src/screen_lyrics.h \
src/screen_outputs.h \
+ src/screen_chat.h \
src/screen_text.h \
src/plugin.h \
src/lyrics.h \
src_ncmpc_SOURCES += src/screen_outputs.c
endif
+if ENABLE_CHAT_SCREEN
+src_ncmpc_SOURCES += src/screen_chat.c
+endif
+
if ENABLE_LIRC
src_ncmpc_SOURCES += src/lirc.c
endif
diff --git a/configure.ac b/configure.ac
index c50445eaa898f18f2e4fc8ee0c287463f4ee4252..4e29197256965c347cd73d5e32d5f6f2a7397729 100644 (file)
--- a/configure.ac
+++ b/configure.ac
AC_MSG_RESULT([$enable_outputs_screen])
+dnl Optional screen - client-to-client chat
+AC_MSG_CHECKING([whether to include the chat screen])
+AC_ARG_ENABLE([chat-screen],
+ AC_HELP_STRING([--enable-chat-screen],
+ [Enable chat screen @<:@default=no@:>@]),,
+ [enable_chat_screen=no])
+AC_MSG_RESULT([$enable_chat_screen])
+if test "x$enable_chat_screen" = "xyes" ; then
+ AC_DEFINE(ENABLE_CHAT_SCREEN, 1, [Enable chat screen])
+fi
+
+AM_CONDITIONAL(ENABLE_CHAT_SCREEN, test x$enable_chat_screen = xyes)
+
+
dnl
dnl Windows OS Resource File
dnl
diff --git a/doc/config.sample b/doc/config.sample
index 54fa82febbe6f7dd57795d359d7d35d21a9aaa9e..5f1f93f6e452cfb95ffe48560a9b1b0c6f19d26e 100644 (file)
--- a/doc/config.sample
+++ b/doc/config.sample
## A list of screens to cycle through when using
## the previous/next screen commands (tab and shift+tab).
-## names: playlist browse help artist search song keydef lyrics outputs
+## names: playlist browse help artist search song keydef lyrics outputs chat
#screen-list = playlist browse
## Default search mode for the search screen. The mode is an
diff --git a/doc/ncmpc.1 b/doc/ncmpc.1
index f72c99c8cc6bc2c6afbdce77673d13f49774f10e..0aabe94ff0782fffb41d05a6a5009dec2e0a9ca0 100644 (file)
--- a/doc/ncmpc.1
+++ b/doc/ncmpc.1
Enable mouse support (if enabled at compile time).
.TP
.B screen\-list = SCREEN1 SCREEN2...
-A list of screens to cycle through when using the previous/next screen commands. Valid choices, if enabled at compile time, are playlist, browse, artist, help, search, song, keydef, lyrics, and outputs.
+A list of screens to cycle through when using the previous/next screen commands. Valid choices, if enabled at compile time, are playlist, browse, artist, help, search, song, keydef, lyrics, outputs, and chat.
.TP
.B search\-mode = MODE
Default search mode for the search screen. MODE must be one of title, artist, album, filename, and artist+title, or an interger index (0 for title, 1 for artist etc.).
diff --git a/src/command.c b/src/command.c
index e3663339ee9837436bbfec350b4690024c32ba69..9495b79aa5ea62301478d9ee0e433c8315824194 100644 (file)
--- a/src/command.c
+++ b/src/command.c
#define F6 KEY_F(6)
#define F7 KEY_F(7)
#define F8 KEY_F(8)
+#define F9 KEY_F(9)
#define C(x) KEY_CTL(x)
static command_definition_t cmds[] = {
N_("Outputs screen") },
#endif
+#ifdef ENABLE_CHAT_SCREEN
+ { {'9', F9, 0}, 0, CMD_SCREEN_CHAT, "screen-chat",
+ N_("Chat screen") },
+#endif
{ { -1, -1, -1 }, 0, CMD_NONE, NULL, NULL }
};
diff --git a/src/command.h b/src/command.h
index 847d5ed7c22c2edf466fc6b58da11897c484ce96..9e8b1664d2475d585be84d71e392753fa26b9d8f 100644 (file)
--- a/src/command.h
+++ b/src/command.h
CMD_SCREEN_HELP,
CMD_SCREEN_LYRICS,
CMD_SCREEN_OUTPUTS,
+ CMD_SCREEN_CHAT,
CMD_LYRICS_UPDATE,
CMD_EDIT,
CMD_INTERRUPT,
diff --git a/src/options.c b/src/options.c
index c331fa54c897a109b69a77e59c848c0216c1c1e1..0129b235eb31f554cd24a91d7d980b0ec91fff2d 100644 (file)
--- a/src/options.c
+++ b/src/options.c
#ifdef ENABLE_OUTPUTS_SCREEN
" outputs-screen"
#endif
+#ifdef ENABLE_CHAT_SCREEN
+ " chat-screen"
+#endif
"\n");
#ifndef NCMPC_MINI
diff --git a/src/screen.c b/src/screen.c
index c34d3962e35b4afb20f48f62e9fa66b34c7d3d2e..4050add277367c224a45b949ffc010a9e8a73b0d 100644 (file)
--- a/src/screen.c
+++ b/src/screen.c
#include "screen_keydef.h"
#include "screen_lyrics.h"
#include "screen_outputs.h"
+#include "screen_chat.h"
#include <mpd/client.h>
case CMD_SCREEN_OUTPUTS:
screen_switch(&screen_outputs, c);
break;
+#endif
+#ifdef ENABLE_CHAT_SCREEN
+ case CMD_SCREEN_CHAT:
+ screen_switch(&screen_chat, c);
+ break;
#endif
case CMD_SCREEN_SWAP:
screen_swap(c, NULL);
diff --git a/src/screen_chat.c b/src/screen_chat.c
--- /dev/null
+++ b/src/screen_chat.c
@@ -0,0 +1,32 @@
+/* ncmpc (Ncurses MPD Client)
+ * (c) 2004-2012 The Music Player Daemon Project
+ * Project homepage: http://musicpd.org
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "screen_interface.h"
+#include "mpdclient.h"
+
+static bool
+screen_chat_cmd(G_GNUC_UNUSED struct mpdclient *c,
+ G_GNUC_UNUSED command_t cmd)
+{
+ return false;
+}
+
+const struct screen_functions screen_chat = {
+ .cmd = screen_chat_cmd,
+};
diff --git a/src/screen_chat.h b/src/screen_chat.h
--- /dev/null
+++ b/src/screen_chat.h
@@ -0,0 +1,32 @@
+/* ncmpc (Ncurses MPD Client)
+ * (c) 2004-2012 The Music Player Daemon Project
+ * Project homepage: http://musicpd.org
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef NCMPC_SCREEN_CHAT_H
+#define NCMPC_SCREEN_CHAT_H
+
+#include "config.h"
+
+#ifdef ENABLE_CHAT_SCREEN
+
+struct screen_functions;
+extern const struct screen_functions screen_chat;
+
+#endif
+
+#endif
diff --git a/src/screen_help.c b/src/screen_help.c
index e0e705b9697b1cd57065bd1b02398518f315d127..ed4db1fc2f668d17411ab662a0efc0486aadadc5 100644 (file)
--- a/src/screen_help.c
+++ b/src/screen_help.c
#ifdef ENABLE_OUTPUTS_SCREEN
{ 0, CMD_SCREEN_OUTPUTS, NULL },
#endif
+#ifdef ENABLE_CHAT_SCREEN
+ { 0, CMD_SCREEN_CHAT, NULL },
+#endif
#ifdef ENABLE_KEYDEF_SCREEN
{ 0, CMD_SCREEN_KEYDEF, NULL },
#endif
{ 2, CMD_NONE, NULL },
{ 0, CMD_PLAY, N_("Enable/disable output") },
#endif
+#ifdef ENABLE_CHAT_SCREEN
+ { 0, CMD_NONE, NULL },
+ { 0, CMD_NONE, NULL },
+ { 1, CMD_NONE, N_("Chat screen") },
+ { 2, CMD_NONE, NULL },
+ { 0, CMD_PLAY, N_("Write a message (not yet implemented)") },
+#endif
#ifdef ENABLE_KEYDEF_SCREEN
{ 0, CMD_NONE, NULL },
{ 0, CMD_NONE, NULL },
diff --git a/src/screen_list.c b/src/screen_list.c
index e0ddecf53390c13c73cbd2aaa4935306f48dd312..5ef6ddba172224f0168389df77aec598c0b573b0 100644 (file)
--- a/src/screen_list.c
+++ b/src/screen_list.c
#include "screen_keydef.h"
#include "screen_lyrics.h"
#include "screen_outputs.h"
+#include "screen_chat.h"
#include <string.h>
#ifdef ENABLE_OUTPUTS_SCREEN
{ "outputs", &screen_outputs },
#endif
+#ifdef ENABLE_CHAT_SCREEN
+ { "chat", &screen_chat },
+#endif
};
void
diff --git a/src/title_bar.c b/src/title_bar.c
index 7fdce0c21dd9a0f63fa83106bf8d27a65943ffd4..e83156519a4890ef2a10c13248638ecdcba00b04 100644 (file)
--- a/src/title_bar.c
+++ b/src/title_bar.c
#ifdef ENABLE_OUTPUTS_SCREEN
print_hotkey(w, CMD_SCREEN_OUTPUTS, _("Outputs"));
#endif
+#ifdef ENABLE_CHAT_SCREEN
+ print_hotkey(w, CMD_SCREEN_CHAT, _("Chat"));
+#endif
#endif
}