---
name: "NJB_Replace_Track_Tag"
section: "3"
platform: "linux"
package: "libnjb1-doc"
version: "1.1-2"
release: "Debian 4.0 (Etch)"
platforms: ["linux"]
url: "https://new.carta.tech/NJB_Replace_Track_Tag"
---

# NJB\_Replace\_Track\_Tag(3)

replace a track tag on the jukebox

## NAME

NJB\_Replace\_Track\_Tag - replace a track tag on the jukebox

## LIBRARY

libnjb

## SYNOPSIS

\#include \<sys/types.h\> #include \<libnjb.h\>

extern int njb\_error

int NJB\_Replace\_Track\_Tag (njb\_t  **\*njb**, u\_int32\_t **trackid**, const char **\*codec**, const char **\*title**, const char **\*album**, const char **\*genre**, const char **\*artist**, u\_int32\_t **length**, u\_int32\_t **tracknum**, u\_int32\_t **filesize**, const char **\*fname**, const char **\*year**, int **protected)**

## DESCRIPTION

This function replaces the tag for track **trackid** on the NJB.  The  **codec** parameter is required, and cannot be NULL, since it tells the NJB what audio format the song track is stored in.  The  **title**,  **album**,  **genre**,  **artist**,  **length ,**  **tracknum ,**  **filesize ,**  **fname**,  **year**,  and **protected** parameters are optional, and can be NULL (pointers) or 0 (integers).  However, as the NJB organizes tracks by artist, album, title and genre, is is strongly recommended that these parameters be provided.

This function increments the NJB's library counter, provided it has not been incremented previously during the session.

## RETURN VALUES

If the transfer is successful, NJB\_Replace\_Track\_Tag returns 0.  Otherwise, -1 is returned and  **njb\_error** is set.

- EO\_BADCOUNT

  The library counter on the NJB could not be updated. The tag replacement was successful.

- EO\_BADDATA

  **songtag** contains invalid data or is not properly formed.

- EO\_BADSTATUS

  A non-zero status was returned by the NJB during the communcation.

- EO\_INVALID

  A required parameter was NULL.

- EO\_NOMEM

  There was not enough memory to create the "tag" for the audio track.

- EO\_RDSHORT

  The NJB sent fewer bytes than expected on the bulk data pipe.

- EO\_TIMEOUT

  The NJB did not verify that the transfer was complete after several queries.  The tag may have still have been replaced successfully.

- EO\_USBBLK

  An I/O error occurred on the bulk data pipe.

- EO\_USBCTL

  An I/O error occurred on the control pipe.

- EO\_WRSHORT

  Fewer bytes than requested were written to the USB pipe.

- EO\_XFERERROR

  The NJB returned a non-zero status when the tag for the track was transferred.

## SEE ALSO

[NJB\_Send\_Track(3)](/NJB_Send_Track/3.md), [NJB\_Get\_Track(3)](/NJB_Get_Track/3.md), [songid(3)](/songid/3.md)
