2 * Copyright (C) 2008-2016 Paul Davis <paul@linuxaudiosystems.com>
3 * Copyright (C) 2009 David Robillard <d@drobilla.net>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #include "pbd/error.h"
22 #include "ardour/tape_file_matcher.h"
30 const char* const tape_file_regex_string = X_("/T[0-9][0-9][0-9][0-9]-");
36 TapeFileMatcher::TapeFileMatcher()
40 if ((err = regcomp (&m_compiled_pattern,
41 tape_file_regex_string, REG_EXTENDED|REG_NOSUB)))
45 regerror (err, &m_compiled_pattern, msg, sizeof (msg));
47 PBD::error << string_compose (_("Cannot compile tape track regexp for use (%1)"), msg) << endmsg;
54 TapeFileMatcher::matches (const string& audio_filename) const
57 if (regexec (&m_compiled_pattern, audio_filename.c_str(), 0, 0, 0) == 0)