#include <assert.h>
#include <wchar.h>
-#ifdef HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
+#include <sys/stat.h>
+#include <math.h>
#include <vlc_common.h>
#include <vlc_plugin.h>
int box_start; // first line of box displayed
int box_idx; // selected line
- msg_subscription_t *sub; // message bank subscription
+ msg_subscription_t sub; // message bank subscription
struct
{
int type;
};
char buf1[MSTRTIME_MAX_SIZE];
char buf2[MSTRTIME_MAX_SIZE];
- unsigned i_volume;
+ float volume;
case INIT_S:
case END_S:
mvnprintw(y++, 0, COLS, _(" Position : %s/%s"), buf1, buf2);
- i_volume = aout_VolumeGet(p_playlist);
- mvnprintw(y++, 0, COLS, _(" Volume : %u%%"),
- i_volume*100/AOUT_VOLUME_DEFAULT);
+ volume = aout_VolumeGet(p_playlist);
+ if (volume >= 0.f)
+ mvnprintw(y++, 0, COLS, _(" Volume : %3ld%%"),
+ lroundf(volume * 100.f));
+ else
+ mvnprintw(y++, 0, COLS, _(" Volume : ----"),
+ lroundf(volume * 100.f));
if (!var_Get(p_input, "title", &val)) {
int i_title_count = var_CountChoices(p_input, "title");
return true;
}
- char *uri = make_URI(path, dir_entry->file ? "file"
- : "directory");
+ char *uri = vlc_path2uri(path, "file");
free(path);
if (uri == NULL)
return true;
static void OpenSelection(intf_thread_t *intf)
{
intf_sys_t *sys = intf->p_sys;
- char *uri = make_URI(sys->open_chain, NULL);
+ char *uri = vlc_path2uri(sys->open_chain, NULL);
if (uri == NULL)
return;
vlc_mutex_init(&sys->pl_lock);
sys->verbosity = var_InheritInteger(intf, "verbose");
- sys->sub = vlc_Subscribe(MsgCallback, sys);
+ vlc_Subscribe(&sys->sub, MsgCallback, sys);
sys->box_type = BOX_PLAYLIST;
sys->plidx_follow = true;
endwin(); /* Close the ncurses interface */
- vlc_Unsubscribe(sys->sub);
+ vlc_Unsubscribe(&sys->sub);
vlc_mutex_destroy(&sys->msg_lock);
vlc_mutex_destroy(&sys->pl_lock);
for(unsigned i = 0; i < sizeof sys->msgs / sizeof *sys->msgs; i++) {