summaryrefslogtreecommitdiffstats
path: root/player/osd.c
Commit message (Collapse)AuthorAgeFilesLines
* options: handle escape sequences in e.g. --playing-msg differentlywm42014-02-201-2/+2
| | | | | | | | | | M_OPT_PARSE_ESCAPES was pretty stupid, and broke the (useful) assumption that string variables contain exactly the same value as set by the option. Simplify it, and move escape handling to the place where it's used. Escape handling itself is not terribly useful, but still allows useful things like multiline custom OSD with "\n".
* options: add --no-terminal switchwm42014-02-101-0/+6
| | | | | Mostly useful for internal reasons. This code will be enabled by default if mpv is started via the client API.
* sub: uglify OSD code path with lockingwm42014-01-181-18/+18
| | | | | | | | | | | | | | | Do two things: 1. add locking to struct osd_state 2. make struct osd_state opaque While 1. is somewhat simple, 2. is quite horrible. Lots of code accesses lots of osd_state (and osd_object) members. To make sure everything is accessed synchronously, I prefer making osd_state opaque, even if it means adding pretty dumb accessors. All of this is meant to allow running VO in their own threads. Eventually, VOs will request OSD on their own, which means osd_state will be accessed from foreign threads.
* player: remove OSD message IDswm42014-01-171-14/+10
| | | | | | These were needed before the last commit, but now they don't do anything anymore. (They were used to decide whether to replace or stack the previous OSD message when a new one was displayed.)
* player: remove OSD stackwm42014-01-171-55/+15
| | | | | | | | | | | If certain OSD messages were displayed at the same time, the hidden messages were put on the stack, and displayed again once the higher priority messages disappeared. The idea was probably that lower priority messages could not hide higher priority ones, and also that the lower messages did not get lost. But in practice, this gives confusing results with OSD messages randomly reappearing for a brief time. Remove it.
* player: don't use OSD message stack for term OSD subswm42014-01-171-13/+16
| | | | | | | | Showing subtitles on terminal used the OSD message stack (which uses a stack to "pile up" messages that were displayed at the same time). This had a bunch of weird and annoying consequences. This accessed a certain osd_state field, which is a minor annoyance since I want to make that struct opaque. Implement this differently.
* msg: move special declarations to msg_control.hwm42014-01-161-0/+1
| | | | | While almost everything uses msg.h, the moved definitions are rarely needed by anything.
* player: handle the corner cases in --term-osd-bar correctlyJohannes Nixdorf2014-01-151-3/+3
| | | | With the old code and pos == width - 2 one character too many is drawn.
* player: use more than 1/100 resolution for --term-osd-barJohannes Nixdorf2014-01-151-1/+2
| | | | | If the terminal width is large enough the position marker jumps over several characters because currently pos only increases in 1/100th steps.
* player: add --term-osd-bar, which shows a status bar on the terminalwm42014-01-151-0/+29
| | | | | Feature request from github issue #451. Disabled by default, will probably stay this way.
* player: don't print status in --idle modewm42014-01-141-1/+1
| | | | Apparently this annoys certain users. Restores old behavior.
* player: redo terminal OSD and status line handlingwm42014-01-131-48/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The terminal OSD code includes the handling of the terminal status line, showing player OSD messages on the terminal, and showing subtitles on terminal (the latter two only if there is no video window, or if terminal OSD is forced). This didn't handle some corner cases correctly. For example, showing an OSD message on the terminal always cleared the previous line, even if the line was an important message (or even just the command prompt, if most other messages were silenced). Attempt to handle this correctly by keeping track of how many lines the terminal OSD currently consists of. Since there could be race conditions with other messages being printed, implement this in msg.c. Now msg.c expects that MSGL_STATUS messages rewrite the status line, so the caller is forced to use a single mp_msg() call to set the status line. Instead of littering print_status() all over the place, update the status only once per playloop iteration in update_osd_msg(). In audio- only mode, the status line might now be a little bit off, but it's perhaps ok. Print the status line only if it has changed, or if another message was printed. This might help with extremely slow terminals, although in audio+video mode, it'll still be updated very often (A-V sync display changes on every frame). Instead of hardcoding the terminal sequences, use terminfo/termcap to get the sequences. Remove the --term-osd-esc option, which allowed to override the hardcoded escapes - it's useless now. The fallback for terminals with no escape sequences for moving the cursor and clearing a line is removed. This somewhat breaks status line display on these terminals, including the MS Windows console: instead of querying the terminal size and clearing the line manually by padding the output with spaces, the line is simply not cleared. I don't expect this to be a problem on UNIX, and on MS Windows we could emulate escape sequences. Note that terminal OSD (other than the status line) was broken anyway on these terminals. In osd.c, the function get_term_width() is not used anymore, so remove it. To remind us that the MS Windows console apparently adds a line break when writint the last column, adjust screen_width in terminal- win.c accordingly.
* player: don't block terminal OSD while seekingwm42014-01-131-3/+6
| | | | | | | | Seeking usually show the status on OSD. In terminal OSD mode, no status is shown, because there is already a separate status line. Unfortunately, the mechanism for showing the status was still active, which forced showing no message while the code for showing seek status was active.
* player: always ise [statusline] for terminal OSDwm42014-01-051-3/+3
| | | | | | This was inconsistent: the actual statusline used [statusline] as message prefix, while other parts of the terminal OSD used [cplayer] (and MSGL_STATUS). This commit makes it consistent.
* player: add --secondary-sid for displaying a second subtitle streamwm42013-12-241-2/+2
| | | | | | | This is relatively hacky, but it's Christmas, so it's ok. This does two things: 1. allow selecting two subtitle tracks, and 2. include a hack that renders the second subtitle always as toptitle. See manpage additions how to use this.
* player: use separate msg prefix for statuslinewm42013-12-211-3/+3
| | | | | So the user can specifically mute or unmute the status line with --msglevel. Accidentally removed with commit 5e0c4ec3.
* Rename getch2....c/h to terminal....c/hwm42013-12-191-1/+1
| | | | | "getch2" really tells nothing about what the heck this code does. It'd be even worse when moving the rest of terminal handling code there.
* player: replace some overlooked mp_msgswm42013-12-191-6/+5
| | | | | There are still some using IDENTIFY, and some without context in configfiles.c.
* Split mpvcore/ into common/, misc/, bstr/wm42013-12-171-3/+3
|
* Move options/config related files from mpvcore/ to options/wm42013-12-171-2/+2
| | | | | | | | | Since m_option.h and options.h are extremely often included, a lot of files have to be changed. Moving path.c/h to options/ is a bit questionable, but since this is mainly about access to config files (which are also handled in options/), it's probably ok.
* Rename mp_core.h to core.hwm42013-12-171-1/+1
| | | | Get rid of the mp_ prefix.
* Move mpvcore/player/ to player/wm42013-12-171-0/+518