Mercurial > pidgin.yaz
view src/mediastreamer/sndcard.h @ 12116:e75ef7aa913e
[gaim-migrate @ 14416]
" This patch implements a replacement for the queuing
system from 1.x. It also obsoletes a previous patch
[#1338873] I submitted to prioritize the unseen states
in gtk conversations.
The attached envelope.png is ripped from the
msgunread.png already included in gaim. It should be
dropped in the pixmaps directory (Makefile.am is
updated accordingly in this patch).
The two separate queuing preferences from 1.x, queuing
messages while away and queuing all new messages (from
docklet), are replaced with a single 3-way preference
for conversations. The new preference is "Hide new IM
conversations". This preference can be set to never,
away and always.
When a gtk conversation is created, it may be placed in
a hidden conversation window instead of being placed
normally. This decision is based upon the preference
and possibly the away state of the account the
conversation is being created for. This *will* effect
conversations the user explicitly requests to be
created, so in these cases the caller must be sure to
present the conversation to the user, using
gaim_gtkconv_present_conversation(). This is done
already in gtkdialogs.c which handles creating
conversations requested by the user from gaim proper
(menus, double-clicking on budy in blist, etc.).
The main advantage to not queuing messages is that the
conversations exist, the message is written to the
conversation (and logged if appropriate) and the unseen
state is set on the conversation. This means no
additional features are needed to track whether there
are queued messages or not, just use the unseen state
on conversations.
Since conversations may not be visible (messages
"queued"), gaim proper needs some notification that
there are messages waiting. I opted for a menutray icon
that shows up when an im conversation has an unseen
message. Clicking this icon will focus (and show if
hidden) the first conversation with an unseen message.
This is essentially the same behavior of the docklet in
cvs right now, except that the icon is only visible
when there is a conversation with an unread message.
The api that is added is flexible enough to allow
either the docklet or the new blist menutray icon to be
visible for conversations of any/all types and for
unseen messages >= any state. Currently they are set to
only IM conversations and only unseen states >= TEXT
(system messages and no log messages will not trigger
blinking the docklet or showing the blist tray icon),
but these could be made preferences relatively easily
in the future. Other plugins could probably benefit as
well: gaim_gtk_conversations_get_first_unseen().
There is probably some limit to comment size, so I'll
stop rambling now. If anyone has more
questions/comments, catch me in #gaim, here or on
gaim-devel."
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Wed, 16 Nov 2005 18:17:01 +0000 |
parents | e67993da8a22 |
children |
line wrap: on
line source
/* The mediastreamer library aims at providing modular media processing and I/O for linphone, but also for any telephony application. Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef SNDCARD_H #define SNDCARD_H #undef PACKAGE #undef VERSION #include <config.h> #undef PACKAGE #undef VERSION #ifdef HAVE_GLIB #include <glib.h> #else #include <uglib.h> #endif #ifdef __cplusplus extern "C" { #endif /* the base class for all soundcards: SndCard */ struct _SndCard; typedef int (*SndCardOpenFunc)(struct _SndCard*,int, int, int); typedef void (*SndCardSetBlockingModeFunc)(struct _SndCard*, gboolean ); typedef void (*SndCardCloseFunc)(struct _SndCard*); typedef gint (*SndCardIOFunc)(struct _SndCard*,char *,int); typedef void (*SndCardDestroyFunc)(struct _SndCard*); typedef gboolean (*SndCardPollFunc)(struct _SndCard*); typedef gint (*SndCardMixerGetLevelFunc)(struct _SndCard*,gint); typedef void (*SndCardMixerSetRecSourceFunc)(struct _SndCard*,gint); typedef void (*SndCardMixerSetLevelFunc)(struct _SndCard*,gint ,gint); typedef struct _MSFilter * (*SndCardCreateFilterFunc)(struct _SndCard *); struct _SndCard { gchar *card_name; /* SB16 PCI for example */ gint index; gint bsize; gint rate; gint stereo; gint bits; gint flags; #define SND_CARD_FLAGS_OPENED 1 SndCardOpenFunc _probe; SndCardOpenFunc _open_r; SndCardOpenFunc _open_w; SndCardSetBlockingModeFunc _set_blocking_mode; SndCardPollFunc _can_read; SndCardIOFunc _read; SndCardIOFunc _write; SndCardCloseFunc _close_r; SndCardCloseFunc _close_w; SndCardMixerGetLevelFunc _get_level; SndCardMixerSetLevelFunc _set_level; SndCardMixerSetRecSourceFunc _set_rec_source; SndCardCreateFilterFunc _create_read_filter; SndCardCreateFilterFunc _create_write_filter; SndCardDestroyFunc _destroy; }; typedef struct _SndCard SndCard; void snd_card_init(SndCard *obj); void snd_card_uninit(SndCard *obj); gint snd_card_probe(SndCard *obj, int bits, int stereo, int rate); int snd_card_open_r(SndCard *obj, int bits, int stereo, int rate); int snd_card_open_w(SndCard *obj, int bits, int stereo, int rate); int snd_card_get_bsize(SndCard *obj); gboolean snd_card_can_read(SndCard *obj); int snd_card_read(SndCard *obj,char *buffer,int size); int snd_card_write(SndCard *obj,char *buffer,int size); void snd_card_set_blocking_mode(SndCard *obj,gboolean yesno); void snd_card_close_r(SndCard *obj); void snd_card_close_w(SndCard *obj); void snd_card_set_rec_source(SndCard *obj, int source); /* source='l' or 'm'*/ void snd_card_set_level(SndCard *obj, int way, int level); gint snd_card_get_level(SndCard *obj,int way); const gchar *snd_card_get_identifier(SndCard *obj); struct _MSFilter * snd_card_create_read_filter(SndCard *sndcard); struct _MSFilter * snd_card_create_write_filter(SndCard *sndcard); #define SND_CARD_LEVEL_GENERAL 1 #define SND_CARD_LEVEL_INPUT 2 #define SND_CARD_LEVEL_OUTPUT 3 int snd_card_destroy(SndCard *obj); #define SND_CARD(obj) ((SndCard*)(obj)) /* SndCardManager */ #define MAX_SND_CARDS 20 struct _SndCardManager { SndCard *cards[MAX_SND_CARDS]; }; typedef struct _SndCardManager SndCardManager; void snd_card_manager_init(SndCardManager *manager); SndCard * snd_card_manager_get_card(SndCardManager *manager,int index); SndCard * snd_card_manager_get_card_with_string(SndCardManager *manager,const char *cardname,int *index); extern SndCardManager *snd_card_manager; #ifdef __cplusplus } #endif #endif